Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
running php script on a .html page spectrus
Is there a way in this world to have a php (in this case voting) script on an .html page? I do not want to rename my index.html and change all the links from all the other pages to it..
Just that one page?
<Files index.html> ForceType application/x-httpd-php </Files>
That'll make apache treat he html file as a php file...
Hmm.. I just blindly used it and now it just downloads the page and views it locally. I guess I'll just have to give in. :) Nick_W
What do you mean, 'blindly used it'? -> Explain please ;)
well, without much understanding of what it does. Just a fancy expression for copy-paste. ;) Nick_W
put it in a file called .htacces and stick that file in your root dir. like /home/users/www/yoursite.com/.htacces
Yeah, yeah, I know what .htaccess is. :) It's just doing what I said earlier - downloads index.html and views it locally. I just do not understand why. jatar_k
there is also the addtype directive [ ...] httpd.apache.org
AddType application/x-httpd-php .html
if your calling it in with a SSI include, why not just add:
AddHandler server-parsed .shtml .html
to your .htaccess in that directory.
A different approach: You could make a new index.php file and create a symbolic link index.html pointing to index.php, provided your configuration allows symbolic links to be followed. Or, alternatively, a RewriteRule might help, transforming requests for index.html to index.php.
Hope it helps,
You could use an IFrame. Cheers.