K
kylord123123
Guest
I'm new to PHP coding. I've recently been using WAMP server.
Since I'm new to it, I've created a "test" folder in the www directory, and I don't have trouble creating php files, such as "index.php".
But, whenever I put PHP code into a HTML file, such as index.html, I can never get the PHP code to work. I've been using simple scripts such as:
<?php
echo "Hello, world!";
?>
It can work perfectly fine when I create the file as "index.php" and save it, but when I add HTML code (The HTML tag, header tag, body, etc.), I can never get the PHP code work. The page always appears blank.
Sample code from index.html:
<html>
<body>
<?php
echo "Hello, World!";
?>
</body>
</html>
Are there any suggestions on how I can get this to work properly?
Since I'm new to it, I've created a "test" folder in the www directory, and I don't have trouble creating php files, such as "index.php".
But, whenever I put PHP code into a HTML file, such as index.html, I can never get the PHP code to work. I've been using simple scripts such as:
<?php
echo "Hello, world!";
?>
It can work perfectly fine when I create the file as "index.php" and save it, but when I add HTML code (The HTML tag, header tag, body, etc.), I can never get the PHP code work. The page always appears blank.
Sample code from index.html:
<html>
<body>
<?php
echo "Hello, World!";
?>
</body>
</html>
Are there any suggestions on how I can get this to work properly?