I have made a validation script to allow access to my site from a mail link.
The code the user recives is:
...verifima.php?webourl=in
fo.php&uid
=password&
email=some
@body.ct
(but sometimes it will header to an article using $id and $op)
where: $uid have the password,
$email user email,
$webourl the url where the script headers.
the script is this:
-------------verifima.php-
----------
----------
-----
<?
$conexio = mysql_connect("localhost",
"","");
mysql_select_db ("database", $conexio) OR die ("No es pot conectar");
$sql="SELECT email, pwd, id FROM usuarios WHERE email LIKE '".$email."' AND pwd LIKE '".$uid."'";
$result=mysql_query($sql);
IF ($row= mysql_fetch_array($result)
)
{
$validat = 'si';
session_register('validat'
);
$origen="mailing";
session_register('origen')
;
$usuari=$row[id];
session_register('usuari')
;
$sesio=SID;
$op=str_replace(" ","+",$op);
if ($webourl)
{
header ("Location: ".urldecode($webourl)."");
}
echo $webourl;
header ("Location: article.php?op=$op&check[]
=$id");
}
ELSE
{
header ("Location: index.htm");
}
?>
--------------------EndOfF
ile-------
----------
-
the variable $webourl exists and you can 'echo' it, but after SESSION_REGISTER() it dissappears. And goes to 'article.php'; but if you refresh the page (in the same browser window) you go to 'info.php' (I have tried with IE,Comunicator and Mozilla).
any hint of how to fix it? $op don't dissapear when it is passed.
Start Free Trial