Title: find out the query string programmatically
Last modified: August 24, 2016

---

# find out the query string programmatically

 *  Resolved [Site Beyond Sight](https://wordpress.org/support/users/site-beyond-sight/)
 * (@site-beyond-sight)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/find-out-the-query-string-programmatically/)
 * If I’m writing custom php to check for $_GET[“affiliates”] how do check to see
   if that variable name was changed in the global options? For example if I changed
   it to $_GET[“referal-id”] how could I find that out via php so it always looks
   for the right one?
 * [https://wordpress.org/plugins/affiliates/](https://wordpress.org/plugins/affiliates/)

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

 *  Plugin Author [itthinx](https://wordpress.org/support/users/itthinx/)
 * (@itthinx)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/find-out-the-query-string-programmatically/#post-5980164)
 * Hi,
 * Here’s a start:
 *     ```
       $pname = get_option( 'aff_pname', AFFILIATES_PNAME );
       $id = isset( $_GET[$pname] ) ? $_GET[$pname] : null;
       ```
   
 * Cheers
 *  Thread Starter [Site Beyond Sight](https://wordpress.org/support/users/site-beyond-sight/)
 * (@site-beyond-sight)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/find-out-the-query-string-programmatically/#post-5980312)
 * Thanks!

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

The topic ‘find out the query string programmatically’ is closed to new replies.

 * ![](https://ps.w.org/affiliates/assets/icon-256x256.png?rev=1118899)
 * [Affiliates](https://wordpress.org/plugins/affiliates/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/affiliates/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/affiliates/)
 * [Active Topics](https://wordpress.org/support/plugin/affiliates/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/affiliates/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/affiliates/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Site Beyond Sight](https://wordpress.org/support/users/site-beyond-sight/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/find-out-the-query-string-programmatically/#post-5980312)
 * Status: resolved