I made php file embeded in HTML and stored by .html extension but php is not outputing on browser. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I made php file embeded in HTML and stored by .html extension but php is not outputing on browser.

<html><head></head><body> <?php echo "Hello World!" ?> </body></html>

2nd Jul 2020, 3:01 PM
Alian Jutt
Alian Jutt - avatar
9 Answers
+ 2
Please go back to the PHP tutorial. I feel you are to add a link in the <head> tag
2nd Jul 2020, 3:23 PM
Emmanuel Akinbo
Emmanuel Akinbo - avatar
+ 4
Though you write HTML inside, extension should be ".php"
2nd Jul 2020, 3:26 PM
Sudarshan Rai
Sudarshan Rai - avatar
+ 1
Ok sir sorry. i m beginner in php
2nd Jul 2020, 3:24 PM
Alian Jutt
Alian Jutt - avatar
+ 1
Yeah, I've seen the error. The extension Save it with .php
2nd Jul 2020, 3:27 PM
Emmanuel Akinbo
Emmanuel Akinbo - avatar
+ 1
Sudarshan Rai can you give example?
2nd Jul 2020, 3:28 PM
Alian Jutt
Alian Jutt - avatar
+ 1
I don't think that's possible Alian Jutt
2nd Jul 2020, 3:35 PM
Emmanuel Akinbo
Emmanuel Akinbo - avatar
+ 1
You cannot write php inside html page, save the page with extension .php, then the code will work.
4th Jul 2020, 3:32 AM
anshu
anshu - avatar
0
No sir they placed tag in body .
2nd Jul 2020, 3:26 PM
Alian Jutt
Alian Jutt - avatar
0
how to give its link in html. Just as we give css link <rel="stylesheet" href="index.css">
2nd Jul 2020, 3:32 PM
Alian Jutt
Alian Jutt - avatar