0
Inserting PHP code inside HTML code
After learning PHP in sololearn I learnt that PHP code can be included inside a HTML code. I tried doing the same using php tags as well using the script tag as given in the php course but still there is no output when I type the php code inside the HTML code. Please help. https://code.sololearn.com/WBl6dsGsplZb/?ref=app
6 Respuestas
+ 1
Mr. FusionCoder
You have to save your file with php extension then you can use PHP.
In Sololearn, Web code means HTML, JS and CSS. So when you write code in Web Code and save it then it save with html extension not php extension.
So you can't use.
You can insert HTML code in PHP but not PHP code in Html.
https://code.sololearn.com/w0F7OWCmgFl0/?ref=app
+ 2
You may include *html* in your *php* file(afaik), not the other way around
+ 2
Oh thanks a lot 🅰🅹 🅐🅝🅐🅝🅣 thanks a lot for your help now I know how to do it thanks again
+ 1
Yes Isaac Fernandes I have tried but the php code outputs the complete HTML code as well together
+ 1
Have you tried saving it as mycode.php and running it on localhost?
0