0

how to add PHP code in HTML??

5th Oct 2016, 3:58 AM
Aalok Bhakat
Aalok Bhakat - avatar
7 Answers
+ 1
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Test Site</title> </head> <body> <?php $text = "This is a text string."; $num = 5; $text2 = "This is another text line that display the number: "; ?> <p><?php echo $text; ?></p> <p><?php echo $text2, $num; ?></p> </body> </html>
5th Oct 2016, 5:06 AM
Fabricio Bertani
Fabricio Bertani - avatar
0
insert between <?php and ?> tags
5th Oct 2016, 4:15 AM
Fabricio Bertani
Fabricio Bertani - avatar
0
could u please give a short example..?
5th Oct 2016, 4:54 AM
Aalok Bhakat
Aalok Bhakat - avatar
0
thnks..👍
5th Oct 2016, 5:14 AM
Aalok Bhakat
Aalok Bhakat - avatar
0
In your .html file <?php write php code here.. ?>
5th Oct 2016, 7:15 PM
Rajesh Patra
Rajesh Patra - avatar
0
the , is wrong you need a . between $text2.$num
7th Oct 2016, 11:47 AM
Jelmer de Vries
Jelmer de Vries - avatar
0
Use .HTML extension
18th Oct 2016, 4:06 AM
Akshay Tandon
Akshay Tandon - avatar