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...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |