Title: Problems with $_GET
Last modified: August 19, 2016

---

# Problems with $_GET

 *  Resolved [Alejandro Benavente](https://wordpress.org/support/users/bnvt/)
 * (@bnvt)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/problems-with-_get/)
 * HI!
 * I’m rather new to WP, but have been successful so far developing a complex blog
   with the help of the documentation and forums. But…
 * I’m trying to implement some functionality using php $_GET, and it doesn`t work.
   The site is so complex now that posting the whole code would be a mess, but I
   got to narrow the problem testing the simplest form:
 *     ```
       $test = $_GET["c"];
       echo "$test";
       ```
   
 * where the url is “whatever/id=4?c=hey”
    and it won’t echo anything.
 * My site is built on top of Starkers and TwentyTen, and I think that there might
   be some function around messing with my $_get attempts.
    I know I’m not providing
   much info, but I don’t know where to start looking for the problem. I’m simply
   out of ideas, and I feel it must be the most simple answer. Any hint would be
   much appreciated.
 * I can provide any further info about the site structure that’s needed.
    Thanks
   a lot!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Alejandro Benavente](https://wordpress.org/support/users/bnvt/)
 * (@bnvt)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/problems-with-_get/#post-1740254)
 * More info:
    I found that search results don’t work in my custom search.php; I
   believe that search relies on $_POST and $_GET, so this should be related.
 * But, I also found that search does work on the original starkers theme search.
   php so now I’m thinking that the problem might be in my custom loop.
    My loop
   makes queries through some query_posts() functions, which have been troublesome
   in the past; I’ll have a look at it.
 *  [DigitalSquid](https://wordpress.org/support/users/twelvefootsnowman/)
 * (@twelvefootsnowman)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/problems-with-_get/#post-1740267)
 * That URL should be: whatever/?id=4&c=hey
 * The question mark goes at the beginning to start the query string and you then
   use `&` to add any extra field-value pairs.
 * Also, you don’t need the quotes around “$test” when using echo. As it’s just 
   a variable than `echo $test` is fine.
 *  Thread Starter [Alejandro Benavente](https://wordpress.org/support/users/bnvt/)
 * (@bnvt)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/problems-with-_get/#post-1740281)
 * You are absolutely right, thanks a ton.
    I was passing the value to the URL through
   an anchor rather than a post form, and the href was obviously badly coded. Still
   having problems with the query, though, but I think that’s another problem altogether.
   Thanks about the echo tip as well!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problems with $_GET’ is closed to new replies.

## Tags

 * [$_get](https://wordpress.org/support/topic-tag/_get/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Alejandro Benavente](https://wordpress.org/support/users/bnvt/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/problems-with-_get/#post-1740281)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
