BooBoo
07-16-2002, 01:50 PM
I need the ability to run .html pages with embedded php. To do this, according to the documentation that I have found, I need to modify the AddType application line in httpd.conf. I need to change the line, AddType application/x-httpd-php .php .phtml, by adding .html to the end of this line.
However, it appears that I must do this site by site.
My questions are:
1. Do I need to .htm also?
2. How can I do this at a server level and avoid having to do it site by site?
3. Do I need to do this at all? Currently, if I add php code in the html page, it does nothing. So I am guessing that this is the problem and by adding .html to this line, it will parse the html page.
Steve-PWH
07-16-2002, 02:35 PM
Why not just run .php pages with embeded HTML?
BooBoo
07-16-2002, 02:46 PM
Running php pages messes up the search engines and indexing.
esdjco
07-16-2002, 03:00 PM
Steve,
Let me see if I can help you with this. Is php currently running on your system?
<?phpinfo(); ?> --- Create a file called info.php and call it from a browser. If php is running you will see the output of the info page. If not then you have some work to do to get php running.
1. No you can simply have a php page with the .php extension and not use the .htm. Its not needed as php pages can have html embedded inside them.
2. :eek: Ehhhh?
3. No. What code are you adding...maybe it does nothing.
Thanks.
BooBoo
07-16-2002, 03:29 PM
I added the code and it showed a really nice PHP info page, PHP 4.1.2.
1. No debate about that.
2. We are an internet company and have been working with Yahoo, MSN, and others. It turns out that the search engines' indexes do not handle php pages very well. This is according to the "expert" that originally setup the web pages.
3. The code that I added to the html page is:
<?php
echo "Hi!"
?>
I wanted to test the php. I need to connect to MySQL and retrieve data from the database to display on the webpage. Price, Inventory Count, and Location. I was under the impression that php and MySQL was a good method to do this. Also, due the the constraints that I am working with hundreds of html pages, I simply wanted to add the php code to the pages and display the info. It can either be displayed on the page or as a popup window from a hyperlink.
Thanks for the help!
BooBoo
07-16-2002, 03:33 PM
Update: On one web site, it works. On the second web site, it cannot find the file. I get a File Not Found Error - The requested URL was not found on this server.
blacknight
07-17-2002, 07:06 PM
Originally posted by BooBoo
Running php pages messes up the search engines and indexing.
It shouldn't do if you code them properly. It WILL mess them up if they are completely dynamic ie. pulling from a database