redarrow Posted October 19, 2006 Share Posted October 19, 2006 how can i decode the incoming decoded end of the url cheers.i sand a email to my self point the link back use a get to valadate the link but i need to get the encoded end of the url decoded but how.we all no you use base64_decode but how can i use that with phaseing the end of the url.this is the code that needs to be decoded from the url.id=redarrow&cmd=yesso afther the ? mark everythink within the link needs to be decoded for the $_GET to work.is there a way to get the incomeing url into a varable to decode it.[code]<?phpif($_GET['cmd']=="yes"){echo "hello";}$pro=base64_encode("id=redarrow&cmd=yes");$link="<a href='http://www.whatever.com/a.php?$pro'>link</a>";$to = '[email protected]';$subject = 'the subject';$message = "<html><body>$link</body></html>";$headers = "From: Do not email back\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n";mail($to, $subject, $message, $headers); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/ Share on other sites More sharing options...
btherl Posted October 19, 2006 Share Posted October 19, 2006 I don't there is an automatic way to decode it. You can just do it manually:[code]$link = "<a href='http://www.whatever.com/a.php?args=$pro'>link</a>";...$dec = base64_decode($_GET['args']);$vals = split('&', $dec);foreach ($vals as $val) { list($varname, $varval) = split('=', $val); $_GET[$varname] = $varval;}[/code]Now $_GET['cmd'] and $_GET['id'] are set. Quote Link to comment https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/#findComment-111091 Share on other sites More sharing options...
redarrow Posted October 19, 2006 Author Share Posted October 19, 2006 we all no how to do it manualy we wont to do it coming from a email link but cheersanyone else cheers. Quote Link to comment https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/#findComment-111094 Share on other sites More sharing options...
Daniel0 Posted October 19, 2006 Share Posted October 19, 2006 Couldn't you just use parse_url? I'm not quite sure what you mean... Quote Link to comment https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/#findComment-111101 Share on other sites More sharing options...
redarrow Posted October 19, 2006 Author Share Posted October 19, 2006 this is what i was trying to do but with grate reading the only function is encodeurl but that not good enough.i was sending my self a email the link in the email i wanted to be conpletly encoded so the user did not no what it was all about.when the user press the link the link would get decoded the server end, then use the link with a $_GET but decoded.i have seen this done but i guess it's a php plugin from somewere. Quote Link to comment https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/#findComment-111116 Share on other sites More sharing options...
Daniel0 Posted October 19, 2006 Share Posted October 19, 2006 So you are trying to obfuscate the url?Edit: Look at this link: [url=http://0x4261ab05/]PHP Freaks[/url] Quote Link to comment https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/#findComment-111144 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.