[PHP] Rare foutmelding

Status
Niet open voor verdere reacties.

Razing

Gebruiker
Lid geworden
13 okt 2008
Berichten
167
Ik krijg een hele rare foutmelding:
PHP:
Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0

Op deze pagina:
PHP:
<?php
$username = $HTTP_POST_VARS["USERID"];
$password = $HTTP_POST_VARS["PWD1"];
$email = $HTTP_POST_VARS["EMAIL"];
$asAdmin = $HTTP_POST_VARS["ASADMIN"];

function doesEmailExist($email) {
  global $dbaseUserData, $leagueID;

  $link = OpenConnection();
  if ($link == FALSE) {
    ErrorNotify("Unable to open connection");
    exit;
  }

  $query = "SELECT email from $dbaseUserData where lid='$leagueID' and email=\"$email\"";
  $result = mysql_query($query)
    or die("Unable to perform query: $query");

  if ($result == FALSE) {
    ErrorNotify("Query Failed : $query");
    CloseConnection($link);
    return TRUE;
  }
  
  $numrows = mysql_num_rows($result);

  CloseConnection($link);

  if ($numrows == 0) {
    return FALSE;
  }

  return TRUE;
} 

function doesUserExist($user) {
  global $dbaseUserData, $leagueID;

  $link = OpenConnection();
  if ($link == FALSE) {
    ErrorNotify("Unable to open connection");
    exit;
  }

  $query = "SELECT username from $dbaseUserData where lid='$leagueID' and username='$user'";
  $result = mysql_query($query)
    or die("Unable to perform query: $query");

  if ($result == FALSE) {
    ErrorNotify("Query Failed : $query");
    CloseConnection($link);
    return TRUE;
  }
  
  $numrows = mysql_num_rows($result);

  CloseConnection($link);

  if ($numrows == 0) {
    return FALSE;
  }

  return TRUE;
} 

if (TRUE == doesUserExist($username)) {
  ErrorRedir($Username_already_exists,"createnewuser.php");
}

if ($allowMultipleUserPerEmail == "FALSE") {
  if (TRUE == doesEmailExist($email)) {
    ErrorRedir($One_user_per_email,"createnewuser.php");
  }
}

if ($username == "") {
  ErrorRedir($Username_required,"createnewuser.php");
}

if ($password == "") {
  ErrorRedir($Password_required,"createnewuser.php");
}

$encr = new Encryption($password);
$encryptpass = $encr->Encrypt();
$password = $encr->pwd;

$link = OpenConnection();

$todaysDate = date("Y-m-d");
$query = "INSERT INTO $dbaseUserData (lid,username,password,email,usertype,since) values ('$leagueID','$username','$encryptpass','$email','1','$todaysDate')";
$result = mysql_query($query)
  or die("Query failed: $query");

CloseConnection($link);

$text = "New User created.\nUser = $username\nPassword = $password\nEmail = $email\nSent to $adminEmailAddr\nVersion = ".VERSION;
@mail($adminEmailAddr, "$PredictionLeagueTitle New User",$text,"From: $email");
@mail($email,$Email_Subject_txt,$Email_Answer_txt,"From: $adminEmailAddr");

UpdateStandingsTable();

if ($asAdmin == "TRUE") {
  forward("showusers.php?sid=$SID");
} else {
  login($username,$password);
}
?>
<meta http-equiv="refresh" content="0;url=?id=toto&ga=index#blijf">
 
Blijkbaar gebruik je een functie die in je huidige PHP-versie niet meer bestaat. Maar ik zie nergens in je script iets over sessies staan.

Je zou eens kunnen proberen om

PHP:
$username = $HTTP_POST_VARS["USERID"];
$password = $HTTP_POST_VARS["PWD1"];
$email = $HTTP_POST_VARS["EMAIL"];
$asAdmin = $HTTP_POST_VARS["ASADMIN"];

te veranderen in:

PHP:
$username = $_POST["USERID"];
$password = $_POST["PWD1"];
$email = $_POST["EMAIL"];
$asAdmin = $_POST["ASADMIN"];
 
$HTTP_POST_VARS is verouderd. Dit werkt alleen als register_globals aan staat (zoals de error al zegt).
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan