Jump to content

decode end url cheers.


redarrow

Recommended Posts

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=yes

so 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]
<?php

if($_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]
Link to comment
https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/
Share on other sites

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.
Link to comment
https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/#findComment-111091
Share on other sites

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.
Link to comment
https://forums.phpfreaks.com/topic/24413-decode-end-url-cheers/#findComment-111116
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.