So, I've been trying to create a Signup/Login process using PHP and MySQL. I created a Signup form, and a handling page. Then I tred it out, set the email as a@a.com
and password as MyPassword
.
I then checked the database and got surprised. The email was correctly inputted, alright, but the password wasn't! It was one of the passwords that I used to test before, and it is a pretty personal one.
Every time I tried it again, the same thing happened. The password was always changed to my personal one whenever I signed up.
The problem is that, in my code, I don't have that personal password, anywhere. I only used it to test my signup flow once, and now it's stuck to my database!
Here, I registered using test credentials. The password is asd
and it's obviously 3 letters long.
But when I check the database, I see the following. Even though I edited the password so you can't see it, it's still obvious it's more than 3 letters long.
Is this some kind of MySQL over-writing thing, that I just don't know about yet?
Here is the full code of the SignUp Page (Might be a little long, bear with me):
<?phpsession_start();$firstName = $_POST['firstName'];$lastName = $_POST['lastName'];$email = $_POST['signUpemail'];$password = $_POST['signUppassword'];include("mysql_base.php");echo "Preparing MYSQL Statement...<br>";echo "<script>";echo "firstPart()";echo "function firstPart() {";echo "document.write('Starting to process MYSQL Statement...')";echo "window.setTimeout(secondPart(),2000)";echo "}";echo "function secondPart() {";echo "document.write('Starting to stop processing MSYQL Statement...')";echo "}";echo "</script>";echo "Started to proccess...<br>";$sql = "INSERT INTO pages_accounts (email, pass, firstname, lastname, confirm) VALUES ('".$email."','".$password."','".$firstName."','".$lastName."','0')";if ($conn->query($sql) === true){ echo "<b>SIGNUP SUCCESS</b><br>"; echo "SUCH HAPPINESS. WOW. MMM.<br><br>"; echo "--Check your mail for a confirmation email. Check SPAM too!--"; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: FoxInFlame Pages<pages@foxinflame.tk>' . "\r\n"; $message = "<html><body><center><div style='background-color:orange'><h1>Confirm your Account</h1><br><h3>At FoxInFlame Pages</h3></div> You seem to have registered for an account at FoxInFlame Pages. Now please click on the following link to complete your registration, and start creating amazing websites!<br><a href='http://www.foxinflame.tk/pages/confirm.php?id=".$conn->insert_id."'>Click Here</a></center></body></html>"; mail($email, "[CONFIRM] Account on FoxInFlame Pages", $message);} else { echo "MUCH SADNESS. SUCH DEPRESSION. FAIL ERROR. NO RETURN."; echo "Error: ".$sql."<br>".$conn->error;};?>