[help] Change Pass error

Joined
Nov 17, 2006
Messages
511
Reaction score
0
Location
Estonia
Code:
<table width="730" border="1" bordercolor="#A0A0A4">
  <tr>
    <td><em><strong>Change User Password</strong></em></td>
  </tr>
  <tr>
    <td height="30">
 <FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']; ?>?act=changepass">
      New Password:
      <input name="newpassword1" type="password" id="newpassword1" />
      Re. New Password:
  <input name="newpassword2" type="password" id="newpassword2" />
  <input type="submit" name="Submit" value="Change Password" />
    </form></td>
  </tr>
  <tr>
    <td height="23">Results:
    <?php 

 if ($_GET['act'] == 'changepass')
{
 $newpass = anti_injection($_POST['newpassword1']);
 $renewpass = anti_injection($_POST['newpassword2']);
 if (valida(Array($newpass,$renewpass)) == true)
 { 
 if ($newpass == $renewpass)
 {
 $query = mssql_query("SELECT * FROM Accounts WHERE UserID='$UserID'");
   if(mssql_num_rows($query)<1){
   echo "Please Login!";
    } else {
   $sql=mssql_query("UPDATE Accounts set Password='$newpass' WHERE UserID='$UserID'");
   if ($sql) echo "Password of $UserID changed to $newpass."; else echo 'There is a problem';
  }
 }
 }
}
?>

Code:
Fatal error: Call to undefined function anti_injection() in C:\AppServ\www\accountmanager\changepass.php on line 22
This is
that line
Code:
 $newpass = anti_injection($_POST['newpassword1']);
 
Back