Hello,
I need help making a script for my page.
I would like to make a index.php page and then when ?page=home is added to that, it goes to the home page, when ?page=aboutus is added to that it goes to the About Us page.
ex.
http://www.mysite.com/index.php?page=home - Home Page
http://www.mysite.com/index.php?page=contactus - Contact Us Page
http://www.mysite.com/index.php3page=support - Support Page
If possible can someone just show me a simple script.
A Website that uses the page script I want is http://www.edgz.com.
Thank You
Multiple Pages - One Page
Moderator: General Moderators
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
check out "Proper use of $_GET with includes: $_GET and include" link found in the Usefull Posts Thread
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
ok, I found a code that i think is right...
so if i wanted to go to the index page, my link would be http://www.mysite.com/index.php?file=index
because if thats the case i get a parse error
Code: Select all
<?
switch ($_GET['file']) {
case "index": include("index.inc.php"); break;
case "file1": include("file1.inc.php"); break;
case "file2": include("file2.inc.php"); break;
case "file3": include("file3.inc.php"); break;
default: include("index.inc.php"); break;
}
?>because if thats the case i get a parse error
I get the error without putting the ?file=index after the url anyway.Parse error: parse error, expecting `'}'' in /web/u54/www22882/www/nicky/get33.php3 on line 3
Re: Multiple Pages - One Page
A website that does it *wrong* I might addnickman013 wrote: A Website that uses the page script I want is http://www.edgz.com.
Edit: Is that your entire script, or is line 3 something different?
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
Re: Multiple Pages - One Page
jshpro2 wrote:A website that does it *wrong* I might addnickman013 wrote: A Website that uses the page script I want is http://www.edgz.com.
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm