icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » PHPsuexec » PHP code inside of HTML pages

PHPsuexec Information and tips

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old March 13th, 2006, 8:48 AM   #1 (permalink)
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
23,929 posts
Gave thanks: 904
Thanked 769 times
PHP code inside of HTML pages

PHP code inside of html pages will only work if the file is named with a php file
extension (filename.php and not filename.html).

You will have to edit other pages that link to filename.html to reflect the
php extension change.
__________________
Have you ever want to draw a windmill, and after that animate it? No problem!
Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 13th, 2006, 5:32 PM   #2 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,687 posts
Gave thanks: 6
Thanked 7 times
or just change .htaccess (add the following line)
Code:
AddHandler application/x-httpd-php html
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks Kickersny.com for this great post!
Shirubia (May 2nd, 2008)
Old March 13th, 2006, 7:13 PM   #3 (permalink)
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
23,929 posts
Gave thanks: 904
Thanked 769 times
Thank you, Kicks.
__________________
Have you ever want to draw a windmill, and after that animate it? No problem!
Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 13th, 2006, 7:19 PM   #4 (permalink)
All Ur Base R Belong 2 Us
Excelling Contributor
 
mr_fern's Avatar
 
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
Quote:
Originally Posted by Kickersny.com
or just change .htaccess (add the following line)
Code:
AddHandler application/x-httpd-php html
That's generally considered a bad idea. All HTML pages will be run through the PHP parser regardless of whether there's any actual PHP code in the file, which unnecessarily chomps on CPU usage.
__________________
Nobody doing nothing
mr_fern is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 13th, 2006, 7:25 PM   #5 (permalink)
I'm Dope as Crack
Resident.
 
David's Avatar
 
Joined in Mar 2004
Lives in Asheboro, NC
Hosted on Pass 7
13,032 posts
Gave thanks: 7
Thanked 29 times
Good point.
__________________
David is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 14th, 2006, 12:42 AM   #6 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,687 posts
Gave thanks: 6
Thanked 7 times
Quote:
Originally Posted by mr_fern
That's generally considered a bad idea. All HTML pages will be run through the PHP parser regardless of whether there's any actual PHP code in the file, which unnecessarily chomps on CPU usage.
Good point, but I think if you're looking to have the majority of your HTML pages contain PHP, it is better than renaming everything (and having search engine links, external links, etc break). If the minority of your pages are PHP, then rename.
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks Kickersny.com for this great post!
Shirubia (May 2nd, 2008)
Old March 22nd, 2006, 2:45 PM   #7 (permalink)
Registered User
Seasoned Poster
 
MacPhoenix's Avatar
 
Joined in May 2003
Lives in LI, NY
Hosted on Pass 46
38 posts
Gave thanks: 0
Thanked 0 times
Kickersny, thank you. All my HTML pages have some sort of PHP include in them, and when I first read this thread, I thought, "oh crap..." I thought from the description of PHPsuexec that we wouldn't be able to use .htaccess to modify the behavior of PHP in Apache. Glad to see I was wrong!!!

And even if you have drag us old-school web guys into the secure future, I'm glad Surpass is making this effort. A couple of folks I know were getting hit with PHP scripts that did all sorts of nasty things to their sites. I was worried about this happening in my own webspace, but you look like you're on top of it. Thanks!
__________________
I doubt it.
Server: Pass 46
MacPhoenix is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 22nd, 2006, 3:34 PM   #8 (permalink)
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Orlando
23,929 posts
Gave thanks: 904
Thanked 769 times
MacP, thanks for dropping by, glad we could help. Your site is looking cool as ever.
__________________
Have you ever want to draw a windmill, and after that animate it? No problem!
Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old March 23rd, 2006, 5:55 PM   #9 (permalink)
Registered User
Seasoned Poster
 
MacPhoenix's Avatar
 
Joined in May 2003
Lives in LI, NY
Hosted on Pass 46
38 posts
Gave thanks: 0
Thanked 0 times
Thank you, Kayla!
__________________
I doubt it.
Server: Pass 46

Last edited by MacPhoenix; March 23rd, 2006 at 5:56 PM.
MacPhoenix is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On