Go Back   HostGator Peer Support Forums > Public Forums > Suggestions

Notices

Reply
 
Thread Tools
  #1  
Old 05-05-2009, 12:00 PM
bobdavis321 bobdavis321 is offline
Hatchling Croc
 
Join Date: May 2009
Posts: 4
Default PHP under HTML

We recently moved to Host Gator. Some of our web pages have PHP code in them even though they are using the html extension. This works fine under dreamweaver and on our old host's servers. Is there a way to allow PHP code in an HTML file on Host Gator? Thanks!
Reply With Quote
  #2  
Old 05-05-2009, 12:11 PM
Pitrow's Avatar
Pitrow Pitrow is offline
Swamp Croc
 
Join Date: Oct 2005
Location: Oregon
Posts: 379
Default Re: PHP under HTML

add the following to the .htaccess file for the website

Code:
AddHandler application/x-httpd-php .html .htm
Reply With Quote
  #3  
Old 05-05-2009, 12:11 PM
virtvir5's Avatar
virtvir5 virtvir5 is offline
King Croc
 
Join Date: Feb 2009
Location: Parry Sound, Canada
Posts: 1,245
Default Re: PHP under HTML

I'm not aware of any way except to reconfigure the server script handlers so that all *.html files were treated as potential PHP scripts. Wouldn't it be simpler just to rename your files that contain PHP code with a *.php filename extension. It won't affect normal processing of their HTML content.
__________________
Regards, Richard
VIRtech.org
Reply With Quote
  #4  
Old 05-05-2009, 12:39 PM
bobdavis321 bobdavis321 is offline
Hatchling Croc
 
Join Date: May 2009
Posts: 4
Default Re: PHP under HTML

The line:
AddHandler application/x-httpd-php .html .htm

Did not work, that I can tell.

The HTML pages containing PHP are referred to from various unknown locations. Renaming them as .php works but not for all of the places they are called from.
Reply With Quote
  #5  
Old 05-05-2009, 12:52 PM
Hullabaloo's Avatar
Hullabaloo Hullabaloo is offline
Junior Croc
 
Join Date: Mar 2008
Posts: 115
Default Re: PHP under HTML

Try:

Code:
AddHandler application/x-httpd-php5 .htm .html
Reply With Quote
  #6  
Old 05-05-2009, 12:57 PM
bobdavis321 bobdavis321 is offline
Hatchling Croc
 
Join Date: May 2009
Posts: 4
Default Re: PHP under HTML

THANKS! It works now.
Reply With Quote
  #7  
Old 05-05-2009, 01:07 PM
usa2k's Avatar
usa2k usa2k is offline
Junior Croc
 
Join Date: Jul 2008
Location: Michigan
Posts: 103
Question Re: PHP under HTML

This sounds kind of backwards to me ...
__________________
Jim, AKA usa2k

VOIPo user, HostGator fan, DSLReports.com regular.
Folding@Home, Team#4, and Foldinator Project.
FAH-Tool, Progressive Tactics, usa2k, ... VoIP
Reply With Quote
  #8  
Old 05-05-2009, 01:43 PM
bobdavis321 bobdavis321 is offline
Hatchling Croc
 
Join Date: May 2009
Posts: 4
Default Re: PHP under HTML

It is called 'inherited stuff'. Who knows who did it years ago. It worked then so they ignored it. Now it is too much work to fix it and we need to write a new web site anyway.
Reply With Quote
  #9  
Old 05-05-2009, 02:18 PM
virtvir5's Avatar
virtvir5 virtvir5 is offline
King Croc
 
Join Date: Feb 2009
Location: Parry Sound, Canada
Posts: 1,245
Default Re: PHP under HTML

Quote:
Originally Posted by bobdavis321 View Post
The HTML pages containing PHP are referred to from various unknown locations. Renaming them as .php works but not for all of the places they are called from.
Well, that could be solved with 301 redirects, but it really comes down to whatever works best for you.
__________________
Regards, Richard
VIRtech.org
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Need Help] I can't run php code on html ice888 Shared Hosting Support 10 04-15-2010 03:44 PM
HTML Help. IronWarrior Webhosting 4 01-15-2008 05:49 PM
Content-type: text/html appearing at top of index.html page acketon Shared Hosting Support 4 07-21-2007 11:35 AM

All times are GMT -5. The time now is 10:21 PM.