Here's the scenario:
A visitor to my site lands on restricted content. I provide a link to the membership options/signup page. Upon completion of signup, I want to redirect the user back to the page they were viewing.
The membership software I'm using (s2member) provides an success=(url) option, so I really just need to send the permalink of the page they were viewing to the signup page.
The restricted content uses a template file, in which I include a signup link (if they do not currently meet membership requirements). I'm trying to use the wpfunction: add_query_arg.
So, I have:
<a href="<?php echo add_query_arg( '$prev_page', get_permalink(), get_permalink( 67847 ) ); ?>">Sign Up</a>
And on the page this links to I see
http:///www.mysite.com/member-sign-up/?$prev_page=http://the-correct-permalink-pf-previous-page/
The problem is, on the memebership page, when I
var_dump( $prev_page );
it returns
null
Is this the correct method for sending a variable using a link?