homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

parsing php help needed
need help

 2:28 am on Nov 12, 2005 (gmt 0)

My apache server provides php; however, I wish to use
php within a htm document.

I have added code:
AddType application/x-httpd-php .htm

to my htaccess file

and then attempted to run a web page
with the following code embedded in in:

<?php echo "I LOVE PHP!";?>

Yet when I try my www.mydomain.test1.htm page I get a blank page in IE

any help would be appreciated




 8:57 am on Nov 12, 2005 (gmt 0)

i use

AddType application/x-httpd-php .html .htm .css .inc .php

do you have this in .htaccess?

ask your host about it. i also use
AddType x-mapp-php4 .php .php4 .htm .html .css
on my windows dev server

is the php code visible in the html source?


 4:13 pm on Nov 12, 2005 (gmt 0)

"is the php code visible in the html source?"

Not sure what u mean by the above

I placed:
<?php echo "I LOVE PHP!";?>

in the html source of a page called test1.htm yet see nothing when I visit the page www.mydomain.com/test1.htm


 5:52 pm on Nov 12, 2005 (gmt 0)

when you view source in the browser what do you see?


 6:04 pm on Nov 12, 2005 (gmt 0)

<meta http-equiv="Content-Language" content="en-us">
Test! web page
<?php echo "I LOVE PHP!";?></h1>

Viewed as source in browser


 6:34 pm on Nov 12, 2005 (gmt 0)

Had to remove the htacccess entries because
pages were not even loading in Firefox,
but attempting to download.

lost...yes, i am


 7:55 pm on Nov 12, 2005 (gmt 0)

well I am assuming this is a typo in your first post

>> www.mydomain.test1.htm page

your AddType line looks fine but obviously isn't quite right

I would probably suggest contacting your host to make sure you can use .htaccess files, hich I am guessing you can as they screwed eveything up.

Also make sure php is installed and that what you are trying should work.


 8:03 pm on Nov 12, 2005 (gmt 0)

first try to add that code in a .php file to just check even if it is being parsed by the server? that might give you any hint


 9:44 pm on Nov 12, 2005 (gmt 0)

Yes, it worked fine in a php page.

Just doesn't work in a htm page with any
entry I have made to htaccess.
Yes, I am able to edit htaccess and changes
do take effect.


also, yes that was a typo above


 10:29 pm on Nov 12, 2005 (gmt 0)

It appears, you may have a setting incorrect or do not have permission/the correct module to add a handler or type, since the page should load with the php string as visible text in htm format -- not deliver a blank page...

The first thing I would do is run phpinfo() and find out if mod_mime is loaded and accessible to you -- If not you will need to contact your host.

Second I would try a simple rewrite or something that I know works, to determine if AllowOverride is set to FileInfo or All.

Third, I would try using AddHandler, rather than type:
AddHandler application/x-httpd-php .htm

Hope this gives you some ideas.



 10:54 pm on Nov 12, 2005 (gmt 0)

Well Thanks anyways, not much seems to work

AddHandler application/x-httpd-php .htm

blank page is the result

my other items in my htaccess seem to work fine:

RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.mydomain\.com
RewriteRule (.*) [mydomain.com...] [R=301,L]
RewriteCond %{QUERY_STRING}!^$
RewriteRule .* - [G]
AddType text/html .shtml .shtm .htm .html

AddHandler server-parsed .shtml .shtm .htm .html
AddHandler application/x-httpd-php .htm

ran php info and didnt see anything about mod_mime so maybe thats the problem

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved