Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts

    passing multiple get variables

    howdy, I need to pass some variables from one page to another such as
    Code:
    http://www.mysite.com?sname=$var,$sphone=$var2
    they all keep coming up in sname, how do you separate multiple variables?

    tia.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After the first ? use & to separate the variables:
    PHP Code:
    http://www.mysite.com?sname=$var&$sphone=$var2 

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    PHP Code:
    http://www.mysite.com?sname=$var&$sphone=$var2
    //if you're bothered about validations use & instead of & 

  • #4
    Regular Coder
    Join Date
    May 2005
    Posts
    563
    Thanks
    0
    Thanked 3 Times in 3 Posts
    & instead of ,

    that uses an ampere

  • #5
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    can we get a record for the most people answering the same question simultaneously?

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    & instead


    Seariously though, you can use whatever you want, just make sure its either stated within your php.ini, or set it using:
    ini_set(arg_separator.input, '&,');
    for instance.
    And of course, validation of XHTML compliancy forces you to use & instead of &.


  •  

    Posting Permissions

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