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

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

PHP Server Side Scripting Forum

    
running php script on a .html page
spectrus

10+ Year Member



 
Msg#: 1795 posted 2:58 pm on Sep 27, 2003 (gmt 0)

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..

 

Nick_W

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1795 posted 3:02 pm on Sep 27, 2003 (gmt 0)

Just that one page?

in .htaccess

<Files index.html>
ForceType application/x-httpd-php
</Files>

That'll make apache treat he html file as a php file...

Nick

spectrus

10+ Year Member



 
Msg#: 1795 posted 3:11 pm on Sep 27, 2003 (gmt 0)

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

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1795 posted 3:12 pm on Sep 27, 2003 (gmt 0)

What do you mean, 'blindly used it'? -> Explain please ;)

Nick

spectrus

10+ Year Member



 
Msg#: 1795 posted 4:48 pm on Sep 27, 2003 (gmt 0)

well, without much understanding of what it does. Just a fancy expression for copy-paste. ;)

Nick_W

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1795 posted 4:51 pm on Sep 27, 2003 (gmt 0)

put it in a file called .htacces and stick that file in your root dir. like /home/users/www/yoursite.com/.htacces

Nick

spectrus

10+ Year Member



 
Msg#: 1795 posted 4:57 pm on Sep 27, 2003 (gmt 0)

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

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1795 posted 5:10 pm on Sep 27, 2003 (gmt 0)

there is also the addtype directive
[httpd.apache.org...]

something like

AddType application/x-httpd-php .html

BergtheRed

10+ Year Member



 
Msg#: 1795 posted 5:55 pm on Sep 27, 2003 (gmt 0)

if your calling it in with a SSI include, why not just add:

AddHandler server-parsed .shtml .html

to your .htaccess in that directory.

mapostel

10+ Year Member



 
Msg#: 1795 posted 6:06 pm on Sep 27, 2003 (gmt 0)

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,

M.

wireman

10+ Year Member



 
Msg#: 1795 posted 2:02 pm on Sep 30, 2003 (gmt 0)

You could use an IFrame. Cheers.

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