Shoutbox

More Website Help Please - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: General (/forumdisplay.php?fid=11)
+---- Forum: General Chit Chat (/forumdisplay.php?fid=14)
+----- Thread: More Website Help Please (/showthread.php?tid=70775)

More Website Help Please by Eddie on 01-17-2007 at 11:49 AM

I have come across a problem, where i have had to recode my website to suit certain things that have to be placed on the site...i have seen on websites like this that it says  "index.php?action=page.php" on the pages. You can see similar on a website called HabboParadise.com when you click a link.

Can someone please lead me to a tutorial or tell me how to do this please :)


RE: More Website Help Please by Ezra on 01-17-2007 at 12:14 PM

Look at this:

http://www.php.net/manual/en/reserved.variables.p...rved.variables.get


RE: More Website Help Please by Eddie on 01-17-2007 at 12:24 PM

Ok i dont even understand that :( Oh well, have some learning to do.


RE: More Website Help Please by Felu on 01-17-2007 at 01:32 PM

code:
<?php
$page = $_GET["page"];
?>
<html>
<?php
switch($page){
    case "contact":
        ...
    break;
    default:
        ...
    break;
}
?>
</html>
so ?page=contact will display the contact page, and if nothing is specified or any thing with doesn't exist is specified it shows the default page.
RE: More Website Help Please by Eddie on 01-17-2007 at 03:21 PM

Is there a way i can do this for links?


RE: More Website Help Please by NanaFreak on 01-17-2007 at 03:24 PM

fulu's code +

code:
<a href="./newpage.php?page=contact">Contact Page</a>


;)
RE: More Website Help Please by Eddie on 01-17-2007 at 03:25 PM

So i put felus page into a php file, and then just use that code??
Will felus code work with various pages with just that one code?


RE: More Website Help Please by NanaFreak on 01-17-2007 at 03:30 PM

ok well i will give you a more advanced one this time

index.php:

code:
<a href="./newpage.php?page=contact">Contact Page</a>

newpage.php:
code:
<?php
$page = $_GET["page"];
?>
<html>
<?php
switch($page){
    case "contact":
        echo "Contact Page";
    break;
    case "other":
        echo "Other Page";
    break;
    default:
        echo "Couldnt find page!";
    break;
}
?>
</html>

click the link in index.php and the browser will then show:

Contact Page

... i hope this helps you out ...
RE: More Website Help Please by Eddie on 01-17-2007 at 03:41 PM

Ok great that works on the site, but im sorry :( How do i get it so it shows the page :S because with the code i cant get the page to come up.

EDIT: I also have a main content area that i want it to load in, and adjust the size of that depending on the size of the "page". Because if you see http://www.haboz.net/v6/ i currently have it running on JavaScript with page changing, but i need it how im asking.

EDIT 2: Unless i can leave it like that, and just have the "News" page using that method, which is the only reason i need it really *-)