Posted by:
gnylakai
(---.dhcp.hckr.nc.charter.com)
I'm a bit of a newb to php, but still a good coder and can't seem to find out what is up with php on wampserver2. I have two similar code examples that should both output the same thing, yet neither of them work properly. I downloaded wampserver2 and installed it properly, but I still don't understand what is wrong. Here are the examples and their output:
Example 1:
<HTML>
<HEAD>
<TITLE>My First PHP Page</TITLE>
</HEAD>
<BODY>
<?php
echo "<p>Hello World!</p>";
?>
</BODY>
</HTML>
**********OUTPUT***********
Hello World!
"; ?>
******************************
---------------------------------------------
Example2:
<HTML>
<HEAD>
<TITLE>My First PHP Page</TITLE>
</HEAD>
<BODY>
<?php
echo "Hello World!";
?>
</BODY>
</HTML>
**********OUTPUT***********
******************************
_________________________________________________
Thats right... nothing. I am pretty positive that this is the standard convention for the php "Hello World" 'program' and I still can't seem to get it right. I'm not sure if there is a minor flaw, or if php is not installed correctly on my computer. Everything in WampServer is running and online, and my files are located in the C/Wamp/www directory.
Any help would be greatly appreciated.