Carry variables in the url in php??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hockeyman10
    New Member
    • Mar 2007
    • 7

    Carry variables in the url in php??

    Hello everyone,

    I have always wondered how to do this.. I have a site in cgi where all I have to do is add something like "&city=Bost on" to the address bar and then access that variable on the page with "$form_data{cit y}" but when I try to do this with a php page it doesnt work. Is there something I have to do to be able to use these variables. Please let me know. Thanks alot for your time.
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    The URL variable is in the city element of the $_GET[] array.
    Code:
    $city = $_GET['city'];

    Comment

    • mihai123
      New Member
      • Mar 2007
      • 13

      #3
      Originally posted by code green
      The URL variable is in the city element of the $_GET[] array.
      Code:
      $city = $_GET['city'];

      the url need to be like this link?variable=v alue&variable1= value1 etc

      Comment

      Working...