Undefined variable error: aloggedin in and Undefined index: Submit in

Asked

Viewed 71 times

-2

I managed to solve the other mistakes but when I will register he gives that mistake:

Notice: Undefined variable: refid in /home/b52uyisu/public_html/Register.php on line 70

$addaccount = mysql_query("INSERT INTO members VALUES('','$username','$password','$email','$ppemail','$ppemail','$refid','0','0.00','0.00','0.00','$name','$address','$city','$zipcode','$telephone','$country','$date','$uip','$uip','0','0.00','no','./avatar.png','0','0','0','0','0','0','0','0','0','0','0','0','0','0')");

Notice: Undefined variable: refid in /home/b52uyisu/public_html/Register.php on line 76

if($refid != '') {

  $qqq = mysql_query("UPDATE members SET totalrefs=totalrefs + '1' WHERE username='$refid'");

}
  • 2

    With a row it gets hard to guess your problem right. They may have changed the config of your server errors.

  • 2

    $loggedin and $aloggedin are different names.

  • 1

    Try to explain your problem better. Make a var_dump($refid) before mistakes see what happens.

1 answer

1

No value set for variable.

Instead of checking the value, you can see if it was set using:

if(isset($refid)){
  $qqq = mysql_query("UPDATE members SET totalrefs=totalrefs + '1' WHERE username='$refid'");
}

Or just delete the error message using a "@" before the variable:

if(@$refid != ""){
      $qqq = mysql_query("UPDATE members SET totalrefs=totalrefs + '1' WHERE username='$refid'");
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.