NSA
sudo apt-get thefuckout.tar.gz
- Dec 9, 2011
- 715
- 86
Hey,
getting really annoyed now been trying to figure out a change password script for my uber hotel.
Here is what i've got:
getting really annoyed now been trying to figure out a change password script for my uber hotel.
Here is what i've got:
PHP:
<?php
session_start();
$connection=mysql_connect("localhost","root","[PASSWORD]");
$db=mysql_select_db("uber",$connection);
$username = $_POST['username'];
$password = $_POST['password'];
$newpassword = $_POST['newpassword'];
$newpassword = md5($newpassword);
$confirmnewpassword = $_POST['confirmnewpassword'];
$confirmnewpassword = md5($confirmnewpassword);
$result = mysql_query("SELECT password FROM users WHERE username='$username'");
if(!$result)
{
echo "The username you entered does not exist";
}
else
if(md5($password)!=mysql_result($result,0))
{
echo "You entered an incorrect password";
}
else
{
if($newpassword==$confirmnewpassword)
$sql=mysql_query("UPDATE users SET password='$newpassword' where username='$username'");
if($sql)
{
echo "Congratulations You have successfully changed your password";
}
else
{
echo "The new password and confirm new password fields must be the same";
}
}//i have added this brace //
?>