SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2003
    Location
    Lisbon - Portugal
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php&mysql kevin book

    this piece of code is on the support files for the book (chapter 4 jokes.php)

    <?php
    if (isset($_GET['addjoke'])): // If the user wants to add a joke
    ?>


    but in the book its missing some

    <?php
    if (isset($addjoke): // If the user wants to add a joke
    ?>

    My question is: What is the function of $_GET[' ...'] ?

    thanks in advance
    jony

  2. #2
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so a search on register_globals for more info, but basically to make sure you know where your data is coming from (for security reasons) you need to specify where to "grab" it from.

    so when you have page.php?addjoke=yes

    you want to get the information from that query string which is "get". There are otheres like, "post", "session" and "cookie" which all get information from those sources. You just need to specify exactly which one to look in

  3. #3
    SitePoint Member
    Join Date
    May 2003
    Location
    Lisbon - Portugal
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $_GET is a variable of PHP?

    its the same of this:
    $HTTP_GET_VARS[]

  4. #4
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep it (more or less) is

  5. #5
    SitePoint Member
    Join Date
    May 2003
    Location
    Lisbon - Portugal
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just tell me one more thing
    where I some documentation about all
    functions and variables (every thing) of PHP?

  6. #6
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    www.php.net
    Is the official site, and each function has examples and user notes which can really help sometimes.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •