Advertisement

03.13.2003 at 03:42AM PST, ID: 20549187
[x]
Attachment Details

variable dissappearing after SESSION_REGISTER()

Asked by boig in PHP and Databases

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=info.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");
   }
?>
--------------------EndOfFile------------------

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
[+][-]03.13.2003 at 04:10AM PST, ID: 8127069

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.13.2003 at 05:07AM PST, ID: 8127422

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.13.2003 at 07:14AM PST, ID: 8128379

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.14.2003 at 02:10AM PST, ID: 8135117

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.14.2003 at 02:18AM PST, ID: 8135148

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP and Databases
Sign Up Now!
Solution Provided By: RQuadling
Participating Experts: 3
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32