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
Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.
Add PHP to HTML
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
Here is how you add PHP to HTML.
For this to work you have to save it as .php not .html
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
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 .
Similar Topics:
User(s) browsing this thread: 1 Guest(s)