+ 11
I want use PHP inside HTML. How do i do that?
5 Réponses
+ 3
Of course you can use PHP inside in HTML. But - no HTML, no browser does not know the PHP comands. It is only deal of web server with PHP module. So or you upload your HTML files with PHP in such web server . Or install such web server in your computer for test/developer purposes. Like XAMPP for example
+ 3
<!DOCTYPE HTML>
<HTML Lang="pt-br">
<Head> <title>php inside HTML</title> <meta charset="utf-8"/></Head>
<Body>
<h1> php <\h1>
<?php
txt for exemplo /* php inside HTML*/
?>
</body>
</HTML>
+ 2
You'll have to save the file as .php and not .html, else the web server might not parse the php code
+ 1
He wants to insert php into the HTML file, not create a file in php, if it was to create a file in php he had asked how to create a file in php. Not how to include php inside your HTML
0
1. create a file with .php extension
2. write your HTML
3. to use PHP with HTML place your PHP code wherever you want like this
<?php
// your PHP code
echo "Good Luck";
?>