Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have write a php code in notepad++ :

the code is below:
HTML
<html>
<head>
<title>Online php execution</title>
</head>
<body>
echo "<h1>Hello PHP!</h1>" ;?>
</body>
</html>


it is generating output :
Hello,php!"; ?>
Posted
Updated 14-Jul-15 0:22am
v2

1 solution

You have no PHP block defined in your HTML so all that written there interpreted as HTML...
You should wrap your echo inside a PHP block...
PHP
<?php <br mode="hold" /?>echo "<h1>Hello PHP!</h1>";
?>
 
Share this answer
 
Comments
tusharkaushik 14-Jul-15 6:36am    
actually the code is:
<html>
<head>
<title>Online php execution</title>
</head>
<body>
<!--?php<br /-->echo "

Hello PHP!

";
?>
</body>
</html>
Kornfeld Eliyahu Peter 14-Jul-15 6:38am    
And?
the <!-- opening is for comment in HTML....
tusharkaushik 14-Jul-15 6:36am    
but no getting result
still
Peter Leow 14-Jul-15 8:51am    
How did you launch this file? Did you deploy this file on a Apache server?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900