Php include problem

Discussion in 'PHP' started by jimmybloggs91, Mar 11, 2008.

  1. #1
    I think it was a php include i had anyway lol.

    I lost the entire coding to the site i was working on and now i have forgotten i key point to it.

    Right what i had was that you would be directed to say index.php?id=random and this would show you the page random in a set position.

    Well what i need to know is what coding do i need to put in to the spot where i want the random to show up?

    Sorry if i didnt make myself clear, and thanks in advance for any help
     
    jimmybloggs91, Mar 11, 2008 IP
  2. jimmybloggs91

    jimmybloggs91 Peon

    Messages:
    665
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I tried searching on google for it but i thought it was a php include but that was just the basic include "index.php" thing
     
    jimmybloggs91, Mar 11, 2008 IP
  3. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #3
    do something like this:

    if($_GET['id'] == "random") { include("randompage.php"); }
    elseif($_GET['id'] == "page2") { include("page2.php"); };

    put above code in some div tag. this might help you
     
    khan11, Mar 11, 2008 IP