Reputation: 231
I'm trying to filter my URL value become hidden due to security purpose. Any solution or method to do that?
I'm doing it this way:
<html
<a href='www.iluvpromo.com/unsubscribe.php?email=$email'>
</html>
and the URL is displayed like this:
http://www.iluvpromo.com/unsubscribe.php?email="email_address"
but I want it to be displayed like this:
http://www.iluvpromo.com/unsubscribe.php
Upvotes: 1
Views: 13871
Reputation:
you can use some encryption code to encrypt your parameter which cannot understand by user.
$myData = array('foo'=>1, 'bar'=>'hax0r');
$arg = base64_encode( json_encode($myData) );
http:www.iluvpormo.com/parameter=$arg
and back:
$myData = json_decode( base64_decode( $_GET['secret'] ) );
Upvotes: 1
Reputation: 7457
You may use session :
in the first page :
<?php
session_start();
$_SESSION['email']=$email;
?>
in the second page :
if(isset($_SESSION['email']))
//do sth
//unset($_SESSION['email']); to destroy the session
another way is to use post variable :
in the first pge :
$_POST['email'] = $email;
in the second page:
if( $_POST["email"])
//do something
another way is using hlink
:
echo hlink ("hyperlinktext", "email", "http://www.iluvpromo.com/unsubscribe.php", "funkyclass", $email);
instead of this:
<a href='http://www.iluvpromo.com/unsubscribe.php?email=$email' class='funkyclass'>hyperlink text</a>
Upvotes: 1
Reputation: 1074
You can do similar 'action' in several ways:
Upvotes: 1
Reputation: 992
Alternatively you could encrypt your querystring or post the value in a form (visible in source though).
Upvotes: 0