php problem bei linkscript

Seite 1 von 1 - Forum: Coding Stuff auf overclockers.at

URL: https://www.overclockers.at/coding-stuff/php_problem_bei_linkscript_117405/page_1 - zur Vollversion wechseln!


CROWLER schrieb am 18.06.2004 um 13:19

soda
was soll das script machen ? - alle files mit einer .php endung verlinken

was hab ich bisher gemacht ß?

Code: PHP
//die datei heisst test.php
<? 
$verz=opendir ('.'); 
while ($file = readdir ($verz)) 
{ 
  if($file{0}!=".") 
  { 
    $endung = strchr($file, '.'); 
    $link = substr($file, 0, -4); 
    if($file != "." && $file != ".." && $file != "test.php" && $file != "") 
    { 
      if($endung =".php") 
      { 
       echo "<a href=\"$file\">$link</a><br>"; 
      } 
     
    } 
  } 
} 
closedir($verz); 
?> 

dadurch
if($endung =".php")
dachte ich mir schaffe ich es DAS NUR .php files verlinkt werden
stimmt aber nicht
verlinkt werden alle datein im ordner - wo ist der fehler :confused:


murcielago schrieb am 18.06.2004 um 13:23

== statt = ;)


CROWLER schrieb am 18.06.2004 um 13:28

Zitat von murcielago
== statt = ;)

:bash:
omg ich bin ja so blind thx




overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2025