Error Undefined variable: aloggedin in and Undefined index: submit in [closed]

-2

I was able to solve the other errors but when I register he gives this error:

  

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'");

}
    
asked by anonymous 19.11.2014 / 02:52

1 answer

1

No value was set for the 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 even just suppress the error message by using an "@" before the variable:

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