Learning php. Hello world won't display using easyphp and writing in notepad++
<html>
<!--HTML-->
<head><title>a quick test</title></head>
<body>a quick test</body>
<p>javascript</p>
<!--javascript-->
<p><script>
document.write("hello world")
</script></p>
<p&g开发者_StackOverflow中文版t;php</p>
<!--php-->
<?php
Echo "hello world";
?>
</html>
The Hello world works for javascript but not in php, what gives? Any suggestions or obvious errors?
thanks
Are you saving this file with a .php file extension? PHP code will not execute within a normal .html file.
If you view source, can you read your PHP? Perhaps your environment is set up wrong.
What does <?php phpinfo(); ?>
yield?
To be w3 valid by the way, your body tag should end before the ending html-tag -> as such:
<body>a quick test
<p>javascript</p>
<!--javascript-->
<p><script>
document.write("hello world")
</script></p>
<p>php</p>
<!--php-->
<?php
Echo "hello world";
?>
</body>
</html>
First of all, before saving any file related to PHP, You have to clear see in which format it is going to Save. Save the file in .php extension, for example : filename.php then execute it at WAMP server. You will find HELLO World.
精彩评论