almodcom
11-30-2007, 05:40 PM
hi i have red this article in one of the websites can we use it in our server?
Converting your HTML files to PHP
First, you can simply open up the page you want to use PHP, and run a little test.
Lets open a file called 'index.htm' or something similar. At the very top of the page, before even the <html> tag add this code
<?
echo "Testing that PHP is running ok... success!";
?>
Now we have a page ready to test for PHP... lets add the PHP functionality for your HTML pages.
upload this file as it have this code "AddType application/x-httpd-php .htm .html" it to the root directory of your website, then rename it to '.htaccess'
This tells your website server to look for any .htm or .html pages and treat them as if they where a .php page... all without even renaming your pages!
You don't even have to update your links, all of your .html or .html pages should be able to run PHP now.
Testing for PHP
Now upload the 'index.htm' page that you added the PHP code to (see above) to your website, and open up your web browser (such as Internet Explorer or Opera).
Type in the name of the uploaded index.htm page, for example: www.mydomain.com/index.htm
If PHP is running properly, you should see the message "Testing that PHP is running ok... success!".
thank you
Converting your HTML files to PHP
First, you can simply open up the page you want to use PHP, and run a little test.
Lets open a file called 'index.htm' or something similar. At the very top of the page, before even the <html> tag add this code
<?
echo "Testing that PHP is running ok... success!";
?>
Now we have a page ready to test for PHP... lets add the PHP functionality for your HTML pages.
upload this file as it have this code "AddType application/x-httpd-php .htm .html" it to the root directory of your website, then rename it to '.htaccess'
This tells your website server to look for any .htm or .html pages and treat them as if they where a .php page... all without even renaming your pages!
You don't even have to update your links, all of your .html or .html pages should be able to run PHP now.
Testing for PHP
Now upload the 'index.htm' page that you added the PHP code to (see above) to your website, and open up your web browser (such as Internet Explorer or Opera).
Type in the name of the uploaded index.htm page, for example: www.mydomain.com/index.htm
If PHP is running properly, you should see the message "Testing that PHP is running ok... success!".
thank you