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

Thread: 

Add PHP to HTML

Ads
banner
banner
ivan Offline referral

Posts: 719
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
?>
damponting44 Offline referral

Posts: 497
Joined: Oct 2016
Reputation: 0

#4
Senior Member
As a matter of course you can't utilize PHP in HTML pages. to httpd.conf petition for what you need to do. Be that as it may, recollect, in the event that you do this then your web server will be moderate, since it will parse even static code which won't contain php code. So the better way will be to make the record expansion .phtml rather than just .html .





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