get URL variable

Posted on 2011-04-29
Last Modified: 2012-05-11

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


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?

Question by:Refael
    LVL 18

    Expert Comment

    by:Greg Alexander
    should be

    LVL 18

    Expert Comment

    by:Greg Alexander
    Having two (?) is the problem in other words
    LVL 18

    Accepted Solution

    The (?) notes the beginning of the query string... and to appended it you will use (&) for each variable after that
    LVL 107

    Expert Comment

    by:Ray Paseur
    PHP has a built-in function to help you avoid problems like this:

    Author Comment


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

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now