Re: why doesn't this work ?

From: Date: Sat, 17 Apr 2004 17:57:14 +0000
Subject: Re: why doesn't this work ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-183730@lists.php.net to get a copy of this message
The browser doesn't know what to do with PHP code. >>If I put the following script in a .php file it would work but if I put it >>in an .html file doesn't work, why? script tag is only used in .html file. >> >><script language = "php"> >>echo "<ul>"; >>if ($handle = opendir('.')) { >> while (false !== ($file = readdir($handle))) { >> if ($file != "." && $file != ".." && >> eregi('\.html$', $file)) { >> echo "<li><a href=\"$file\"><font >> color=\"#CC0000\">$file</ >> >>font></a></li><br>"; >> } >> } >> closedir($handle); >>} >> >>echo "</ul>"; >></script>

« previous php.general (#183730) next »