From f34632fe23309a5d239fb415bcde68318b58413f Mon Sep 17 00:00:00 2001 From: Manan Ahuja Date: Thu, 15 Oct 2020 04:57:04 +0530 Subject: [PATCH] Update register.php Hi, I have updated some SQL queries using PHP 7 so that it might not depreciate, and as I am learning PHP 7 so might propose some new changes as well. I have also put some encoding functions to your password so that if any SQL injection occurs, client data remains safe. --- register.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/register.php b/register.php index 3072ce8..eecf58a 100644 --- a/register.php +++ b/register.php @@ -13,9 +13,9 @@ $mob=$_POST['mob']; $gender=$_POST['gender']; $email=$_POST['email']; -$pw=$_POST['pw']; -$cpw=$_POST['cpw']; -$sql = "INSERT INTO passengers (p_fname, p_lname, p_age, p_contact, p_gender, email, password) VALUES ('$fname', '$lname', '$age', '$mob', '$gender', '$email', '$pw');"; +$pw=base64_encode($_POST['pw']); +$cpw=base64_encode($_POST['cpw']); +$sql = "INSERT INTO passengers SET p_fname = '".$fname."', p_lname = '".$lname."', p_age = '".$age."', p_contact = '".$mob."', p_gender = '".$gender."', email = '".$email."', password = '".$pw."'"; if(mysqli_query($conn, $sql)) { $message = "You have been successfully registered"; @@ -112,4 +112,4 @@

- \ No newline at end of file +