Welcome to WebmasterWorld Guest from 54.224.164.166

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP on html page

     
11:14 pm on Jul 14, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 4, 2002
posts:720
votes: 0


Does anyone knows how to use php tags in .htm or .html page?
11:22 pm on July 14, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 6, 2002
posts:1092
votes: 0


NeedScripts,
Welcome to WMW. We hope you find what you are looking for and stick around.

PHP tags inside an HTML document are no different then PHP tags inside a PHP document. The real issue is what interpreter is parsing your HTML files. You need to make sure Apache uses the PHP parser on all files that have the .HTML extension.

12:14 am on July 15, 2002 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7575
votes: 0


Welcome NeedScripts

Drop PHP in where you need it like so:

<p>Today's date is <?php echo date('F j, Y'); ?></p>

12:43 am on July 15, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:June 3, 2002
posts:169
votes: 0


if you're using Apache, you might want to add the following line to your httpd.conf file:

for php4

AddType application/x-httpd-php .html

for php3

AddType application/x-httpd-php3 .html

but this will make the php engine to parse all html files, so make sure that's what you want.

mavherick

12:48 am on July 15, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 20, 2001
posts:478
votes: 0


Optionally you could have parsing on for .htm, and not for .html, so your static pages would not be parsed, but the ones containing php would be. Name any pages with php .htm, etc
5:03 pm on July 15, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 4, 2002
posts:720
votes: 0


Thanks for all the help. I am going to try it out, hope this stuff works ;)

Thanks again.

NeedScripts

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members