Jump to content

Manipulate GET


unemployment

Recommended Posts

I need to be able to pull this URL in my form action:

 

/login?onlogin=http://domain.com/messaging?action=read&cid=130&utm_source=new_message&utm_medium=email&utm_campaign=direct_mesage_link

 

I need everything after "/login?onlogin=" but when I do:

 

if (isset($_GET['onlogin']))
{
     echo $_GET['onlogin']; die();
}

 

It only returns http://domain.com/messaging?action=read and I need it to return the entire URL.  How can I achieve this?

Link to comment
https://forums.phpfreaks.com/topic/255782-manipulate-get/
Share on other sites

Well, the URL parameters are being split by the presence of "&" in the URL.

 

So, it's breaking at where &cid=130 kicks in and adding "cid" as a new URL parameter (same with &utm_source etc.).  If you need to pass this kinda info in the URL, you will need to look at http://php.net/manual/en/function.urlencode.php and its urldecode counterpart.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/255782-manipulate-get/#findComment-1311200
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.