PDA

View Full Version : Parsing HTML with PHP codes ?



firebirdfan
06-21-2004, 05:17 AM
I tried putting the xhtttp- thing in the conf file to setup a html or htm file to activate my php scripts in it but it won't work.
So I guess, we'll have to get name the file with the php extension instead ?
Or did you guys get it working ?

wildjokerdesign
06-21-2004, 07:46 AM
Not sure if this would work for you but I have some htm and html files that I use SSI to pull in the php code. The code I want to use is in a php file that I just call with SSI in the html file where I want the output.

firebirdfan
06-21-2004, 07:09 PM
Thanks Shawn, I haven't tried ssi before, will surely try it someday :)

FZ
06-22-2004, 12:36 PM
What (code) did you put where (which file(s)) to try and get it to work? If I remember correctly, this issue popped up a long time ago and the solution involved removing some default configuration (as well as modifying/adding new stuff).

firebirdfan
06-22-2004, 07:27 PM
Yes, it's some config on the httpd.conf file, I cant remember off hand what was needed to be added. Maybe the time when I added it, it missed out some parts & got some jibberish instead.
I'll try SSI it's kind of cool I think :)

firebirdfan
06-23-2004, 01:38 AM
I just tried my luck again by adding

<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml .html
AddType application/x-httpd-php-source .phps
</IfModule>

After adding that, when I accessed the site, I got a request to download the file instead of getting to view the site itself.

I must be missing something.

FZ
06-25-2004, 04:10 PM
I put this in a .htaccess file in a directory on my site to test, and it works for me:


<IfModule mod_php4.c>
AddType application/x-httpd-php .html
AddType application/x-httpd-php-source .phps
</IfModule>


In fact, the code you have works perfectly for me, too...