Reputation: 1345
My question spawns from me sending an email to the user with something like the following:
As you can see, what I'm trying to do is pass a url as the parameter "dest" so that the login page will know where to redirect after the user logs in. However, I'm presented with the following:
This is the View I use to create the email:
<p>
<?if($this->invitation->user):?>
<a href='<?=$this->serverUrl($this->baseUrl().$this->url(array(
'action'=>'index',
'controller'=>'login',
'dest'=>$this->url(array(
'action'=>'confirm',
'controller'=>'invitation',
'confirmation_key'=>$this->invitation->confirmation_key
))
)));?>'>Log in to confirm this invitation.</a>
//The view continues...
Any idea on how to keep this from translating the URI encoded items to their literal value would be greatly appreciated.
Upvotes: 3
Views: 484
Reputation: 106
You can also upgrade your link like this:
<a href='<?=$this->serverUrl($this->baseUrl().$this->url(array(
'action'=>'index',
'controller'=>'login',
'dest'=>base64_encode($this->url(array(
'action'=>'confirm',
'controller'=>'invitation',
'confirmation_key'=>$this->invitation->confirmation_key
))))
));?>'>Log in to confirm this invitation.</a>
But on the /login/index
, you will need to use the base64_decode()
to get the original Not the most pretty solution, but if you are not able to use the simple querystring, this is a way, how to pass a string via URL safely.
http://en.wikipedia.org/wiki/Base64
Upvotes: 0
Reputation: 53603
$_SERVER['referer']
Upvotes: 1
Reputation: 14447
Can't you just send it over as a simpel GET parameter?
That's how it's mostly done actually.
Upvotes: 6