"; //provide feedback to screen
$dbhandle = sqlite_popen("auth_v2.sqlite", 0666, $err_msg); //open an sqlite database, put into $dbhandle which is the handler
if(!$dbhandle)die("Could not open the database");
//CREATE TABLE
$query="CREATE TABLE LOGIN2 (username VARCHAR(255), password VARCHAR(255), passcrypt VARCHAR(255))"; //create table LOGIN with two fields, username & password
if(!sqlite_query($dbhandle, $query))
{echo "table not newly created, maybe already exists
";} //error message
//COLLECT USER DETAILS
$varUser = ($_POST["user"]); //collect user from form, put into variable
$varPass = ($_POST["pass"]); //collect pass from form, put into variable
//ENCRYPT PASSWORD
crypt($_POST["pass"], "pw"); //encrypt pass, when it is collect CHECK WHAT pw is possibly its reference
$varCrypt = crypt($_POST["pass"], "pw" );
//PUT VALUES INTO LOGIN2
$query = "INSERT INTO LOGIN2 VALUES ('$varUser', '$varPass', '$varCrypt')"; //insert the variable values into table, pass will be encrypted now
if(!sqlite_query($dbhandle, $query)) { echo "Could not insert table row"; } //error message
sqlite_close($dbhandle);
?>
user
";
echo "user " . htmlspecialchars($_POST["user"]) . " : encrypted password = " . crypt($_POST["pass"], "pw");//echoes crypted pw //html special chars converts eg < into <, encrypt "pass" check what "pw" does
echo "
";
?>
...added to database.