SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,322
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    multiple GET values in url - how to seperate?

    i've got a value in the url like this:- ...file.php?p=100 for example and then retreiving it using $_GET['p']. that's fine but how do i seperate different values? say i wanted a t variable ..?p=100t=50 isn't going to work is it? as the t is getting mixed up with the p value. how do i seperate those 2 variables? thanks.

  2. #2
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,322
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your URL should be written this way:

    Code:
      (says that variables follow)
                  v
    www.domain.com?var1=x&var2=y
                         ^
                (variable/value separator)
    You must separate your variables in the URL with a "&"

    Then you can get the with $_GET["var1"] and $_GET["var2"], etc.
    John

  4. #4
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,322
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    thanks

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And the XHTML way to do it would be page.php?a=1&b=2...

  6. #6
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and since this is HTML issue and not a PHP issue, I am assuming it was an accident that it was posted in this forum?

    Aaron
    Aaron Brazell
    Technosailor




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
  •