Hello,
Im having trouble trying to encrypt the password's that are being inserted into the database.
Here is my register process file -
<?php
require_once("db/connect.php");
session_start();
//Declare Variables
$Username = $_POST['username'];
$Email = $_POST['email'];
$Email1 = "@";
$Email_Check = strpos($Email,$Email1);
$Password = $_POST['password'];
$Re_Password = $_POST['re-password'];
//Check To See If All Information Is Correct
if($Username == "")
{
die("Opps! You don't enter a username!");
}
if($Password == "" || $Re_Password == "")
{
die("Opps! You didn't enter one of your passwords!");
}
if($Password != $Re_Password)
{
die("Ouch! Your passwords don't match! Try again.");
}
if($Email_Check === false)
{
die("Opps! That's not an email!");
}
//Insert Into Database
if(!mysql_query("INSERT INTO users (email, username, password)
VALUES ('$Email', '$Username', '$Password')"))
{
die("We could not register you due to a error (Contact the website owner if this continues to happen.)");
}else{
die("User Created");
}
?>
Now im not sure about how i would do it but i want to md5 encrypt the password that is being inserted in to database so if anyone can help me ill be very grateful for your help.