"; //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.
Admin Username:
Admin Password:
Username (email address):
Password:
"; print ""; print "usernamepasswordpasscrypt"; foreach ($result as $arow) //$result is an array, $row is each line of the array { echo ' ' . $arow['username'] . ' ' . $arow['password'] . '' . $arow['passcrypt']. ''; //print to screen the username and password retrieved from the database table called LOGIN } print ""; print "
";
  print_r( $result);  																					//prints the contents of the array
  print "
"; sqlite_close($dbhandle); //close the database handler ?>