wood burning stoves*
The moose likes Tomcat and the fly likes inner php in a html file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "inner php in a html file." Watch "inner php in a html file." New topic
Author

inner php in a html file.

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
ok i have apache, which supports php.

when i do the following in a .html file, the script doesnt execute for some reason.



why won't it echo hello in the browser?

I have another .php file that i call in a form, and that works fine.

Thanks,


Justin Fox


You down with OOP? Yeah you know me!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Did you set up the .htaccess file so it knows what to do?

If you have no clue, this is how you do it:
http://www.desilva.biz/php/phpinhtml.html

Eric
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
cool man thanks, ill definately do that at work tommorow.

but now i have a different problem, I use Ubuntu at home.

I installed apache2 and php5, but when i go to my

/var/www directory, it tells me i dont have permission to change the
index.html file.

I tried some chmod stuff, but i dont think im doing it right.

If anyone can help, that would be great.

Thanks A Lot,


Justin Fox
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The permissions probably need to be set to root. [It probably will effect all of the include files too]

If you are on a private system you can try to do chown 777 and see if that clears things up.

Eric
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
hey, is that .htaccess thing for linux or windows? because i dont see any .htaccess file, and when i create one in the htdocs folder the inner html parsing still doesnt work.

Justin Fox
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
and by the way, i have php triad
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

This convo should be in a different forum...let's see...how about...the Apache forum.
[ October 25, 2007: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
I never figured out how to get apache to parse my php in the .htm or .html files, so ive been saving all my fils .php and that works just fine.


Thanks anyways,

Justin Fox
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inner php in a html file.