Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

120 users online



index.php?page=contests

index.php?page=contests

Currently viewing this thread: 1 (0 members and 1 guests)


Page 1 out of 2
Aki

Aki

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! Smile

Thanks in advanced! Grin

ShaunTobias

ShaunTobias

Neversidian
Status: Offline!

Put this code in your main page (where you want the content to load)

Code:

<?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.

Aki

Aki

Neverside Newbie
Status: Offline!

Do I edit the thing in the code where it says "[page]"??

Sorry I am a noob ::classic:

Aki

Aki

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?

Ynhockey

Ynhockey

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

Ynhockey

Ynhockey

Neverside Newbie
Status: Offline!

As for the 2nd question, i'm afraid i don't understand.

___________________

Learn HTML

Aki

Aki

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?

Ynhockey

Ynhockey

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

Aki

Aki

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)

Ynhockey

Ynhockey

Neverside Newbie
Status: Offline!

Yes, that's pretty much right. But instead of renaming your files, why not just edit the links ?

___________________

Learn HTML

Page 1 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0083 seconds.