Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a file through php when an application requests it

Status
Not open for further replies.

endeavor88

Programmer
May 3, 2005
4
0
0
US
I have a program that requests an .htm page. I wanted to make this a dynamic php page, so I added .htm extention to the list of extentions that my apache server will redirect to php. Also, this file is not in the standard document root (apache/htdocs). So, I used aliases.

But now I have a problem...the application does not request the file through my server. Because the file and the application is on the same computer, the application requests the file without ever going through my server. It's just as if I opened the .htm file while browsing my hard drive.

Is there a way to make it so that this specific file has to go through the server before anyone accesses it?
 
Are you saying that when the PHP file comes up, the browswer outputs the code? If so, you may have:

- an incorrectly specified interpreter path
- no execute permission

That's what comes to my mind at the moment.
 
Does it work when in your DocumentRoot (any .htm file with php in it?) I am wondering if this is something to do with aliases.

Also when you made this change (adding .htm to the PHP AddType directive) did you restart your server?

Regarding the execute permission, none of my scripts appear to have execute permission on them and they are interpreted fine.
 
Okay, what I really want to do is pretty silly. If you use AIM(AOL Instant Messenger), then you know users have profiles. These profiles are stored as .htm files in a folder on the hard drive. I want to make that file dynamic, so that when the AIM program requests it, the file goes through the php interpreter first.

I really, really doubt it's possible to do this. But I am an amateur at all this stuff. If you don't know a way, do you at least know if it's possible?
 
I don't think this is possible. Other AIM clients probably request it directly from your AIM client, ignoring apache totally, and in this case the PHP directives would be ignored.

Think of it this way: I doubt apache is a prerequisite for installing AIM.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top