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      = 'admin@whatever.com';
$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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.