Re: why doesn't this work ?

From: Date: Sun, 18 Apr 2004 14:33:49 +0000
Subject: Re: why doesn't this work ?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-183766@lists.php.net to get a copy of this message
On Sun, 2004-04-18 at 10:27, Pooya Eslami wrote: > Yes, the server supports php, and I don't want to make it into a php file > because its a big html file and I just need this little script on it. Why > cannot I embed php in html files? You CAN embed PHP in .html files PROVIDED THAT YOUR WEBSERVER HAS ENABLED SUPPORT. Since you do not have access to the webserver then it is up to your provider to enable support. Generally they WILL NOT enable support since the .html extension is reserved for non-scripted HTML content. This means developers can lessen the load on the server by not having regular HTML content pass through a script interpreter. Your needs are in the minority, so it's "suck it in time" where you either remove the dynamic part, change the extension, or start hosting your own webserver. Cheers, Rob. > "Andy Ladouceur" <ladouceur@shaw.ca> wrote in message > news:20040418042903.79860.qmail@pb1.pair.com... > > It's already been mentioned, but you do need to ensure you are using a > > .php extension on the file. Also, forgive me if this has already been > > covered, but are you sure the server even supports PHP? > > > > Try creating a new file with: > > <?php > > phpinfo(); > > ?> > > > > And save it as something.php, check and see if it returns a table full > > of information or not. > > > > Andy > > > > Pooya Eslami wrote: > > > I put this in the body of an html file: > > > > > > <?php > > > 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>"; > > > ?> > > > > > > the output page contains : > > > > > > $file > > > "; } } closedir($handle); } echo " > > > "; ?> > > > > > > I don't understand why. > > > > > > "Daniel Clark" <dclark@nwlink.com> wrote in message > > > news:20040417232405.422396DB66@smtp3.pacifier.net... > > > > > >>Can you post the code and error. > > >> > > >> > > >> > > >>>>I took out the scrip tags and put in <?php in the beginning and ?> > > >>>>at > > > > > > the > > > > > >>>>end, but it returns this: > > >>>> > > >>>>$file > > >>>>"; } } closedir($handle); } echo " > > >>>>"; ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#183766) next »