Title: Pass Variable (with pretty permalinks)
Last modified: August 19, 2016

---

# Pass Variable (with pretty permalinks)

 *  [derekelcreativecom](https://wordpress.org/support/users/derekelcreativecom/)
 * (@derekelcreativecom)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/pass-variable-with-pretty-permalinks/)
 * Hi. I am trying to pass a variable to a wordpress page through a link link this:
   
   [http://mysite.com?showall=yes](http://mysite.com?showall=yes)
 * I can’t get the variable to pass. I’ve tried using the get_query_var() function
   and can’t get it to work.
 * Here’s what i’m trying to do:
    In my template, i want to show content based on
   whether a variable is set in the link. The situation is that i have a page with
   links to files that i only want the viewer to see after providing information.
   so i have a form which collects info and sends an autoresponse providing this
   link: [http://mysite.com?showall=yes](http://mysite.com?showall=yes).
 * Then the template is set up like this:
 *     ```
       <? if (isset($showall)) { ?>
       // display some content
       <? } else { ?>
       // display some different content
       <? } ?>
       ```
   
 * this is not the best solution i’m sure and obviously not secure (that’s not an
   issue right now). i originally had the autoresponse email send the user a universal
   password. the template showed different content for logged in users and users
   not logged in. however, the client wants to bypass the login and get a direct
   link after the user fills out the form.
 * Can someone please provide a suggestion or even just tell me how to pass a variable
   in the url when i’m using pretty permarlinks?

The topic ‘Pass Variable (with pretty permalinks)’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [derekelcreativecom](https://wordpress.org/support/users/derekelcreativecom/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/pass-variable-with-pretty-permalinks/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
