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=yesI 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.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.