QUOTE(Brian Chandler @ Jan 9 2010, 02:36 AM)
If you mean the address must be something.php, then no, this is not true. Something has to tell the server (Apache, etc) to pass files to the php interpreter -- it's just that usually this happens by default if the filename is xxx.php. There are also different ways to run the php interpreter: if you want to keep files it uses away from public view on a shared server, you need to use some kind of "wrapper" script so that the interpreter runs as user You (Me), rather than as "Nobody", or whatever Apache runs as.
The site I am doing this change to is on its own server, not shared. I was under the assumption that in order to get php codes (like php include codes, or php action script) to work on the page, then I thought I was going to have to change each page to something like this
CODE
<html>
<head>
<title></title>
</head>
<body>
<?php ?>
</body>
</html>
Are you saying I can keep the file extensions the way they are with the .htm, but then just add this following code in order to get whatever php script I am adding to work properly? (along with changing .htaccess)
CODE
<?php ?>
QUOTE
Are you going to "reorganise" the site, so all the page names are completely different? (Bad Idea!) If not, I see no reason to change the file names: what the user sees is still an html page.
Well I have to go through page by page to add the correct codes for CSS, also clean up some stuff that is not needed, but no I do not want to reorganize the site. I want to keep all the pages on the same URL they are currently on. The great thing is with this new HTML editor I have I can change a whole bunch of pages all at once to save time.
Since I was adding php script I thought the site could no longer have the .htm extension, actually someone else told me that too but it seems like he may have been wrong. he told me that if I kept the extension at .htm then none of the php codes would work right.
QUOTE
If you have a page which is a "program" -- for example a search page -- it seems somehow more reasonable to call it search.php, because it's unlikely you will ever write exactly the same program in a different language. But if the page is "data", such as fishcookery.htm, then the program that happens to be churning it out really is irrelevant.
I was planning on adding a php search engine for my site. I currently use the Google Search box you can make in AdSense, it works great but I want my own search engine. I will probably be asking about making one of these too eventually.
By the way this is what is currently on my .htaccess file.
CODE
ErrorDocument 404 /404.shtml
AddHandler server-parsed shtml html htm
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^.+\.php$ /bogusfile
Should I add what Christian recommended of:
CODE
AddType application/x-httpd-php .php .html .htm
thanks guys!