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.
queryInsert="INSERT INTO x (Password)".
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:
$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))
if ($username==$data['Username'] && $password==$data['Password'])
I understand the code for the salt encryption is pretty simple, but if someone could give me a start I be very grateful