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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing .htm for php code

Status
Not open for further replies.

MasterKaos

Programmer
Jan 17, 2004
107
GB
Ok I was wonderring what options I have for getting Apache to parse index.htm for php code. The server is running on a webhosting provider, so I don't have access to the .conf file. I read in another post that

you can serve any extension as a php page
ie .xxx
AddType application/x-httpd-php .xxx (process as a php page)
<IfModule mod_dir.c>
DirectoryIndex zzz.xxx index.html index.php
</IfModule>
(server zzz.xxx before any other page)


Is there anything in phpinfo() that will tell me what extensions are being parsed for php code?

If only .php files are getting parsed and i can't edit the Apache configuration, is there any way i can work around this? Would the html <script></script> tag work?

Redirects are out of the question because i'm using the referer property in the php script, so the php code has to be in the page that is being requested by the browser.

Any suggestions?

----------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
First of all, HTML <SCRIPT>...</SCRIPT> tags won't help because ehey define client-side scripting code blocks.

There is no way to know what file extensions are being parsed as PHP files without examining th httpd.conf file.

In terms of changing the settings, the AddType directive can be used in a .htaccess file, too.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
look at .htaccess files useage, in these you can specify apache directives regarding acces,file types,password restrictions, indexes etcetc etc.. just type .htaccess into google. (check you isp supports use of - normaly they do within reason.)

So you can specify your own default index file for your webspace.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top