php?ID=xx

Discussion in 'PHP' started by nonito, Jun 18, 2009.

  1. #1
    I am new to php and from an example I try to make a web page which contains html and php pages.
    In the example the php page has a link to <a href="example.php?ID=10"> or <a href="example.php?recordID=20">.
    The "ID´s" are text messages and become part of the page in a frame.
    My problem is how do I have to make these ID´s (format?). because I cannot locate these ID´s in the example.
    Thanks for your help.
     
    nonito, Jun 18, 2009 IP
  2. SHOwnsYou

    SHOwnsYou Peon

    Messages:
    209
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you're wondering what the significance of ID=xx is...

    The browser has passed a $_GET variable to the example.php page. This shows up due to the ?ID= at the end of the page extension.

    example.php would have $ID = $_GET['ID']; in the page coding. ID is being used a unique identifier, so it knows that you want whatever item has 10 (if it was example.php?ID=10) as its unique identifier.

    After passing the $_GET['ID'] variable, the website can use it for a variety of things. Query a database, use the ID number passed in a script, or any other seemingly endless possibilities.

    Why you would use ?ID=XX is to create a dynamic webpage. Using a unique identifier, you no longer have to make a new page for each option. Instead, you can make one page, and have it call specific, standardized information about a large number of objects, only by knowing the ID number. It saves on time and standardizes presentation of information.

    If this is not what you're looking for, clarify and I will explain more.
     
    SHOwnsYou, Jun 18, 2009 IP
  3. credobyte

    credobyte Peon

    Messages:
    38
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    index.php?ID=24
    means the same as
    $ID = 24

    You should take a look at $_GET :)
     
    credobyte, Jun 18, 2009 IP
  4. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Both are same only when register globals are ON. In most of the servers, register globals are set OFF, because of security reason.

    case of index.php?ID=24, the value of ID can be used as $_GET['ID'] or $_REQUEST['ID']
     
    techbongo, Jun 19, 2009 IP
  5. dweebsonduty

    dweebsonduty Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    Digital Goods:
    1
    #5
    techbongo's got it.
     
    dweebsonduty, Jun 27, 2009 IP
  6. IMaster

    IMaster Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    if you want to send variables via url than use <form method='GET'></form>
    if you want retrieve variable value than use $Get_['id'] or simply $id if global registers are ON
     
    IMaster, Jun 28, 2009 IP