Jump to content


Photo

Simple php beginner question?


  • Please log in to reply
2 replies to this topic

#1 Adamw2006

Adamw2006
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 27 August 2006 - 01:25 PM

Hello all, i am new to php and i was just wondering how i create page ids. For example i am wanting to know how to make the 'index.php?id=home' 'index.php?id=contact' sorta pages/sections?

I just can't find anywhere that tells me how to do this. I know it's probably VERY easy, but like i said i am new to this.

Thanks!
Adam.

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 27 August 2006 - 01:29 PM

http://www.php.net/switch

is your best bet and safest way :)

Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 27 August 2006 - 02:17 PM

Somethng like this

switch ($_GET['page'])
{

case "conact":
include('contact.php');
break;
       			
case "news":
include('news.php');
break;

default:
include('home.php');
}

where home.php is the main content on the index page
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users