IT Community - Software Programming, Web Development and Technical Support

PHP on pages without a .php extension

This is a discussion on PHP on pages without a .php extension within the PHP Programming forums, part of the Web Development category; Hi, How to Use PHP on pages without a .php extension...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-17-2007, 05:59 AM
sivaramakrishnan sivaramakrishnan is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 74
sivaramakrishnan is on a distinguished road
Post PHP on pages without a .php extension

Hi,

How to Use PHP on pages without a .php extension
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-17-2007, 07:54 AM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: PHP on pages without a .php extension

Hi sivaraman,

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:
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.
__________________
With,
J. Jeyaseelan

Everything Possible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
install xslt extension for php.? JSureshkumar PHP Programming 0 01-16-2008 08:32 PM
Only $0.14 for .CN Extension Domain Name Bettypeng Networking & Internet Connectivity 0 12-06-2007 01:52 AM
To use PHP in pages with a .html extension sivaramakrishnan PHP Programming 1 08-11-2007 05:27 AM
Advantages of DOM extension over VO extension in silk test senthilkannan Testing Tools 0 07-30-2007 03:54 AM
What's your favorite extension for Firefox for SEO? spid4r Search Engine Optimization 0 03-09-2007 12:32 AM


All times are GMT -7. The time now is 04:22 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0