PHP code not being executed
Posted by: fabien117 (---.fbx.proxad.net)
Date: January 07, 2011 12:54PM

Hi all,

The WAMP server is running on Windows 7 and the apache service is also started. When I type [localhost], I get the WAMP start up page, however the php script is not being executed by the server (http://localhost/hello.php).

For example the script below:

<html>
<body>
<p>This is standard HTML.</p>
<?php
echo "Hello World";
?>
</body>
</html>

The result I am getting on the browser is ' This is standard HTML ' and the 'Hello World' is not being executed.

Thanks for your help,

Fabien

Options: ReplyQuote
Re: PHP code not being executed
Posted by: scottmacneill (---.sip.cha.bellsouth.net)
Date: January 07, 2011 07:32PM

If your html file doesn't have a php extension (i.e. filename.php, not filename.html) PHP will not execute. The extension tell the server to expect php coding.

Options: ReplyQuote
Re: PHP code not being executed
Posted by: yfastud (Moderator)
Date: January 08, 2011 02:41AM

Either you need to have php extension or setup to embed php in html winking smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.