Page 1 of 1

Newbie Question Regarding Page Name

Posted: Sun Feb 05, 2006 3:47 pm
by MikeEller
Hi,
Just started playing with PHP.
One question...
An HTML file must have the .php extension...correct?
If so, how do I use that for my main html document? The "index" page that the server looks for when I
enter the url to the web site in a browser.

Thank you,
Mike

Posted: Sun Feb 05, 2006 4:10 pm
by Chris Corbyn
index.php should load fine if the web server is set up to support PHP ;)

Doesn't matter if you rename a plain HTML file to .php even there's no PHP inside it. But then again you wouldn't need to give it a .php extension if it's not a PHP file :)

Posted: Sun Feb 05, 2006 4:42 pm
by MikeEller
OK,
I tried that and when I navigated to the page...I got a blank page.
The website host says PHP is supported.
So, does that blank page indicate that PHP is not configured on the server?

Thanks,
Mike

Posted: Sun Feb 05, 2006 6:23 pm
by nickman013
It may be somthing in the .htaccess file, but you should be able to have index.php for your main page.

If you can only have html

then make the index.html and put this in it

Code: Select all

<META HTTP-EQUIV="Refresh" CONTENT="5; URL=html-redirect2.html">
CONTENT
how many number of seconds before the redirect occurs.

URL
the page that it will redirec to.

good luck

Posted: Sun Feb 05, 2006 7:03 pm
by Chris Corbyn
Post your code. It sounds like you have an error in the code and they have error reporting disabled ;)

You can try adding this line to the top of your script ;)

Code: Select all

<?php error_reporting(E_ALL); ?>

Posted: Sun Feb 05, 2006 7:25 pm
by timvw
If you use error_reporting, you always need to make sure you don't forget to invite his friend ini_set('display_errors', TRUE); to the party :)

Posted: Sun Feb 05, 2006 7:49 pm
by xEzMikex
do you have an html file in it called index? delete it...