<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>
It only displays the html part, not the stuff in php tags? I'm just following the w3 tutorial.
<!DOCTYPE html>
<html>
<body>
<h1>My first PHP page</h1>
<?php
echo "Hello World!";
?>
</body>
</html>
It only displays the html part, not the stuff in php tags? I'm just following the w3 tutorial.
First thing first check that if your php is properly installed on your system if you are using windows or xampp then upload this file inside htdocs folder and try to run using localhot/index.php whatever your file name is.
And it will run properly. Let me know if you want more detail. If you are not sure how to run php on windows install xampp using this link:http://filehippo.com/download_xampp/ and once it is isntalled run apache and php and put your code inside htdocs folder. This should be easy
If you open this file locally as an .html
file on your desktop or something it's not gonna work. You need to create a local server on your machine, install PHP and run on that.
I recommend https://www.mamp.info/en/ to get you started and where you can install PHP which instructions can be found here: http://php.net/manual/en/install.php