Home arrow Forum arrow The Internet arrow Programming arrow How to use PHP in pages with a .html extension (or any other) Spacer
Spacer

Main Menu

Home
Shop
News
Domains
Forum
Web Hosting

Login Form

Welcome, Guest. Please login or register.
January 09, 2009, 01:14:06 AM
Username: Password:
Login with username, password and session length

Forgot your password?

Links

How to use PHP in pages with a .html extension (or any other)
My Community
January 09, 2009, 01:14:06 AM *
Top 10 Web HostingWelcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Shop Login Register  
Pages: [1]
  Print  
Author Topic: How to use PHP in pages with a .html extension (or any other)  (Read 1063 times)
moinuddin102
Jr. Member
**
Posts: 65
4.00 credits

View Inventory
Send Money to moinuddin102

View Profile
« on: September 04, 2006, 10:25:45 AM »

To be able to use php code on a page with an extension other than .php, you need a server which supports .htaccess files.

To add an extension to be parsed for php, create or edit a file called .htaccess (with the dot first) containing the following line:
Quote
AddType application/x-httpd-php .html .moo .htm
This tells the server to check for php code and execute it in files with extensions .html, .moo or .htm. So upload that .htaccess file in the same folder as your .html files with PHP code inside them (using PHP tags: <?php ... ?>) then when you view them in the browser, the PHP should be dealt with as you’d expect from a PHP page.
Logged
SEO Articles

My Community
« on: September 04, 2006, 10:25:45 AM »

 Logged
hug
Full Member
***
Posts: 220
0.00 credits

View Inventory
Send Money to hug

View Profile Email
« Reply #1 on: September 04, 2006, 01:00:14 PM »

Huh...I don't think I want to use this future...I still prefer .php. Sounds better for me.
Logged
SEO Articles
My Community
« Reply #1 on: September 04, 2006, 01:00:14 PM »

 Logged
Cincian
Full Member
***
Posts: 196
6.00 credits

View Inventory
Send Money to Cincian

View Profile
« Reply #2 on: September 05, 2006, 02:58:46 PM »

kind of pointless, I mean unless your paranoid that someone will exploit your code.
Logged
SEO Articles
Teragonto
Newbie
*
Posts: 19
39.00 credits

View Inventory
Send Money to Teragonto

View Profile Email
« Reply #3 on: December 17, 2006, 07:53:24 PM »

This is completely pointless... Who would care if your site was in php if the code couldn't be taken out unless you were hacked.
Logged
SEO Articles
FnatiK
Newbie
*
Posts: 13
25.00 credits

View Inventory
Send Money to FnatiK

View Profile Email
« Reply #4 on: January 31, 2007, 03:25:12 AM »

just use the php tags..jeez
Logged
SEO Articles
romeo_2005
Full Member
***
Posts: 101
169.00 credits

View Inventory
Send Money to romeo_2005

View Profile Email
« Reply #5 on: July 08, 2007, 01:10:02 PM »

i dont know anything about PHP
Logged
SEO Articles
Shadow1243
Sr. Member
****
Posts: 439
479.00 credits

View Inventory
Send Money to Shadow1243

ForeverShadowww@live.com
View Profile Email
« Reply #6 on: July 09, 2007, 11:10:25 PM »

thankss..
Logged
SEO Articles
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Spacer