PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Wed Mar 03, 2004 10:00 am
Hey, Recently I purchased some web space that supports PHP, ASP, mySQL, Perl etc, etc.. but my index page has to have a *.html extension. I want it so I can log users straight in if they have a cookie set which was produced by the site itself. Is it possible to do this with the index.html file?
Regards
Joe
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Wed Mar 03, 2004 10:02 am
you can get the server to parse html files aswel as PHP files.
Ask your provider.
Mark
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Wed Mar 03, 2004 10:03 am
HHmmm, how would i go about doing that then. Is there any sites which tell me how to do it?
Regards
Joe
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Wed Mar 03, 2004 10:05 am
Another way i thought was if i made the index.html file a redirection to index.php?
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Wed Mar 03, 2004 10:08 am
i cannot see any reason why the host will allow you to use PHP everywhere EXCEPT your index page, i recommend you contact your host
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Wed Mar 03, 2004 10:08 am
its in the apache configuration.
You can also do it in a .htaccess file by adding this line
AddType application/x-httpd-php .php .html
(i think)
Mark
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Wed Mar 03, 2004 10:10 am
thats exactly what i thought he meant bech but if your read closely
its not, either it ain't or his explanation is incorrect
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Wed Mar 03, 2004 10:11 am
OK thanks guys. I will try some things out and if nothing works then I will be contacting my host!
code_monkey
Forum Newbie
Posts: 16 Joined: Tue Jul 08, 2003 6:13 am
Location: UK
Contact:
Post
by code_monkey » Wed Mar 03, 2004 10:13 am
what about using ssi's to achieve this, you could call a bit of php in to the html page as a server side include using the <!--#include virtual="file.php" --> and use it to generate whatever output you need. Normally you just need to create a .htaccess file to allow this.
penguinboy
Forum Contributor
Posts: 171 Joined: Thu Nov 07, 2002 11:25 am
Post
by penguinboy » Wed Mar 03, 2004 2:33 pm
Bech100 wrote: its in the apache configuration.
You can also do it in a .htaccess file by adding this line
AddType application/x-httpd-php .php .html
(i think)
Mark
That would any .html file to be parsed as a .php file.
Really what he needs is something like
(I never use .htaccess, but this is from httpd.conf file)
Code: Select all
DirectoryIndex index.html index.htm index.php
infolock
DevNet Resident
Posts: 1708 Joined: Wed Sep 25, 2002 7:47 pm
Post
by infolock » Wed Mar 03, 2004 10:05 pm
penguinboy wrote: Bech100 wrote: its in the apache configuration.
You can also do it in a .htaccess file by adding this line
AddType application/x-httpd-php .php .html
(i think)
Mark
That would any .html file to be parsed as a .php file.
Really what he needs is something like
(I never use .htaccess, but this is from httpd.conf file)
Code: Select all
DirectoryIndex index.html index.htm index.php
would that really be so bad though? i mean, keeping it to where all htm/html files are parsed as php. it doesn't effect the html, and he may want to just use html extensions to hide the coding language he uses...