Newbie Question Regarding Page Name

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

Post Reply
MikeEller
Forum Newbie
Posts: 11
Joined: Sun Feb 05, 2006 3:43 pm

Newbie Question Regarding Page Name

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 :)
MikeEller
Forum Newbie
Posts: 11
Joined: Sun Feb 05, 2006 3:43 pm

Post 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
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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); ?>
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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 :)
xEzMikex
Forum Commoner
Posts: 38
Joined: Sat Jan 21, 2006 10:18 pm
Location: Canada

Post by xEzMikex »

do you have an html file in it called index? delete it...
Post Reply