Page 1 of 1

php executing as html

Posted: Tue Feb 08, 2011 6:34 am
by blackdub
Hello

I just finished the installs of php, mysql and apache (with success). Now, I want to see the result of my first phpcode in firefox but apparently it is executed as html. I'm sure there is nothing wrong with the code, because I took it from my text-book. Can anyone help me to solve this problem?

Thanks

Re: php executing as html

Posted: Tue Feb 08, 2011 3:38 pm
by Jade
Make sure you have php tags around your php and that it's in a file with a .php extension.

Test.php file would have this inside:

Code: Select all

<?php
echo "hey there";
?>

Re: php executing as html

Posted: Tue Feb 08, 2011 4:29 pm
by Doug G
You have to put your php file in a web directory and call it through a url like http://localhost/myphpfile.php