Forum Moderators: phranque
Okay, here we go...
My original problem was that my server or something, wasn't letting me use php in html...so after a quick google I found this:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
(http://www.example.biz/php/phpinhtml.html)
So I go to my .htaccess, and add those lines, and upload the NEW AND IMPROVED file!
Well, thats where I learned that from that point on, everytime I went to a .php file I had (for example a simple .php email script) it would either prompt for a download, or show bits of code throughout the page.
So, once again, I thought I could handle it by searching google...and after alot of different tries, after changing my .htaccess file for about 2 hours with no luck, I decided I would register here and post for some assistance.
if anyone could help me, or even give me a guess or pointer in the right direction I would be very grateful.
(If you guys don't know how to FIX it, I wouldnt mind resetting it all, but how would I do that?)
Thanks again,
Sean
aka
aPu
[edited by: jatar_k at 11:55 am (utc) on June 19, 2007]
[edit reason] no urls thanks [/edit]
AddType application/x-httpd-php .htm .html
AddHandler application/x-httpd-php .htm .html
more info [google.com]
Jim
HTML to parse as HTML (and not prompt for download on .html / .htm files)
and
PHP to parse as PHP (and not prompt for downloads on .php files)
:) I dont know if that clarifies but...thats the only way I know to say it.
Thanks again,
~Sean
The problem is that early PHP used a 'kludge' to get the server to execute PHP code. They used the "AddType" directive (incorrectly) instead of the AddHandler directive. We live with the resulting problems today.
As a result, all I can do is refer you to the "more info" link above, suggest that you read through the first ten threads (you'll see that you're not the only one with this problem), and try *all* of the various work-arounds.
One thing that makes a major difference (from reading those threads myself before linking to them) is whether your PHP is executed as CGI or as an Apache module. To reduce the time you spend researching and experimenting on your server, ask your host which way they have PHP configured on your server.
We also have a PHP forum here at WebmasterWorld, and there are several good threads in the PHP forum library about configuring PHP.
Jim