
January 14th, 2004
05:46 PM
Neverside Newbie
Status: Offline!
index.php?page=contests
Hi Everybody,
My bro told me that there was something like index.php?page=soandso here... I couldn't find it anywhere.
Could somebody direct me to the place where it explains how you do this "question mark" thing with your pages?
If you don't have a link please explain it to me! 
Thanks in advanced! 

January 14th, 2004
05:50 PM
Neversidian
Status: Offline!
Put this code in your main page (where you want the content to load)
<?php
if(!empty($HTTP_GET_VARS[page]) and file_exists("./$HTTP_GET_VARS[page].php")) {
include("./$HTTP_GET_VARS[page].php");
} else {
include("defaultpage.php");
}
?>
then just type a little paragraph on a page and save it testing.php and upload it, you can then go to:
http://www.yoursite.com/mainpage.php?page=testing
That's a simple way to do it.
___________________
STphp - Modern Web Solutions - CLOSED
ShaunTobias.co.uk - Blog and Portfolio - CLOSED
Look out for LookCreative.co.uk in September.

January 14th, 2004
05:57 PM
Neverside Newbie
Status: Offline!
Do I edit the thing in the code where it says "[page]"??
Sorry I am a noob ::classic:

January 14th, 2004
06:29 PM
Neverside Newbie
Status: Offline!
Nvm... I got it to work but um...
Is there a way where I can keep it... wait for example...
index_2.php?page=testing
now how can i still make it so its index_2.php but a different ?page=testing_2nd_page
like have two files still using index_2.php?
do you understand me?

January 14th, 2004
06:29 PM
Neverside Newbie
Status: Offline!
No, you don't edit that, but i recommend using ['page'] instead of [page].
Also, I suggest replacing $HTTP_GET_VARS with $_GET (the newer version).
There are also a number of things i would personally do differently there, but they're not really necessary... unless you really want to know.
___________________
Learn HTML

January 14th, 2004
06:30 PM
Neverside Newbie
Status: Offline!
As for the 2nd question, i'm afraid i don't understand.
___________________
Learn HTML

January 14th, 2004
06:33 PM
Neverside Newbie
Status: Offline!
Like... is there a way to have TWO files "under" index_2.php
Like this:
index_2.php?page=testing
index_2.php?page=contests
...and so on...
Is there a way to have two files "under" index_2.php?
I've seen people stuff like that. My bro has a site like:
index.php
index.php?page=news
index.php?page=links
index.php?page=shoutbox
and tons others. How do you do that?

January 14th, 2004
06:37 PM
Neverside Newbie
Status: Offline!
With regular text links:
<a href="?page=news">News</a>
<a href="?page=contests">Contests</a>
Etc... (they'll only be included when the user clicks the link)
___________________
Learn HTML

January 14th, 2004
06:40 PM
Neverside Newbie
Status: Offline!
Oh so... If you have that on "index" page you just name a file contests and news.php and it automatically does it for you?
Just clarifing myself of what you just said. (or how my brain took it in :P)

January 14th, 2004
06:59 PM
Neverside Newbie
Status: Offline!
Yes, that's pretty much right. But instead of renaming your files, why not just edit the links ?
___________________
Learn HTML