Morning all,
Thanks for all the responses, but wondered if someone can post some generic code so I can see it in action, remembering that Im using MSSQL database.
The story is:
The woner of this site creates the users from inside the cms, basically they do it and then hand the details out, so this is that page.
Code:
$uPassword=$_POST['uPass'];
queryInsert="INSERT INTO x (Password)".
"VALUES('$uPassword')";
So thats the upload bit, very easy I know but just wanted to go through it. The owner then would like the password to be encrypted and sent to the database, and he will then hand write a letter to the new user with his/her new password on.
Then I have built a separate log in page:
Code:
if(isset($_POST['login']))
{
$tsql = "SELECT * FROM Users where Live_User=1";
$stmt = sqlsrv_query($conn, $tsql);
if( $stmt === false )
{
echo "Error in executing query.</br>";
die( print_r( sqlsrv_errors(), true));
}
while($data = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC))
{
// extract($data);
$username=$_POST['txtuser'];
$password=$_POST['txtpass'];
if ($username==$data['Username'] && $password==$data['Password'])
{
$error1="correct";
}
}
}
I understand the code for the salt encryption is pretty simple, but if someone could give me a start I be very grateful
Bookmarks