Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

get URL variable


in a URL i am passing variables in the following form:

?void=84?cid=46

i am trying to retrieve the cid variable using the $_GET function but something is not working.
when i am using "print_r($_GET);" this is what is prints:

Array ( [void] => 84?cid=46 )

how do i get the cid value back from the URL?


0
Refael
Asked:
Refael
  • 3
1 Solution
 
Greg AlexanderLead DeveloperCommented:
should be


?void=84&cid=46
0
 
Greg AlexanderLead DeveloperCommented:
Having two (?) is the problem in other words
0
 
Greg AlexanderLead DeveloperCommented:
The (?) notes the beginning of the query string... and to appended it you will use (&) for each variable after that
0
 
Ray PaseurCommented:
PHP has a built-in function to help you avoid problems like this:
http://php.net/manual/en/function.http-build-query.php
0
 
RefaelAuthor Commented:

yes of course! thank you so much for alerting me on that.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now