Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

Add PHP to HTML

Ads
ivan Offline referral

Posts: 713
Joined: Jul 2013
Reputation: 6

#1
Senior Member
Is it possible to add PHP code to HTML file? My website is mostly HTML pages because I am good at HTML programming but I know very little about PHP that's why I don't want my entire website to be in PHP, I just want to insert a few lines of PHP code into HTML. Can you help
maya Offline referral

Posts: 1,058
Joined: May 2013
Reputation: 34

#2
Posting Freak
I understand you! Actually it is very easy to add PHP code to HTML file. Try this:
Here is your normal HTML file that has extension .html

Code:
<html>
<head>
<title>Your HTML title</title>
</head>
<body>
HTML code
</body>
</html>

Here is how you add PHP to HTML.

Code:
<html>
<head>
<title>HTML title</title>
</head>
<body>
HTML code
<?php
Your PHP code goes here
?>
HTML code
</body>
</html>

For this to work you have to save it as .php not .html
inder Offline referral

Posts: 12
Joined: Feb 2016
Reputation: 0

#3
Junior Member
Add this code in the html


<?php
Your PHP code goes here
?>





User(s) browsing this thread: 1 Guest(s)