Re: insert md5 password

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The relevant PHP code looks like :-

    $Surname = strip_tags($_POST['Surname']);
    $FirstName = strip_tags($_POST['FirstName']);
    $uname = strip_tags($_POST['uname']);
    $passwd = strip_tags($_POST['passwd']);
    $accesslevel = strip_tags($_POST['accesslevel']);
    $passwd = md5($passwd);
// echo "<br>get_magic_quotes";
    if (!get_magic_quotes_gpc())
        {
        $_POST['passwd'] = addslashes($_POST['passwd']);
        }
    $regdate = date('Y/m/d H:i:s');
// echo "<br>Prepare";
$insert = sprintf("INSERT INTO Users (FirstName, LastName, Usrname, Passwrd, AccessLevel, last_login, UserID) VALUES ('%s', '%s', '%s', \"0x%s\", '%d', '%s', '%d')", $FirstName, $Surname, $uname, $passwd, $accesslevel, $regdate, $_SESSION['UID']);
    $Reply = mssql_query($insert, $link);
echo "<br>".$insert;
    if ($Reply == FALSE)
        {
 echo "<br> Error in Insert";
 echo "<br>".get_sql_error($link)."<br>";

$Message = sprintf("%s %d <br>Record not inserted. Please refer problem to Admin.", __FILE__, __LINE__);
        trigger_error($Message, E_USER_ERROR, $link);
        exit;
        }

    DBDisConnect();
    header("location: index.shtml");
    exit;
?>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux