Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysql_connect("localhost","11fonga","cat");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("11fonga", $con);
- $pass = $_GET['password'];
- $pass2 = $_GET['password2'];
- $uppercase = preg_match('@[A-Z]@', $pass);
- $lowercase = preg_match('@[a-z]@', $pass);
- $number = preg_match('@[0-9]@', $pass);
- if ($pass !== $pass2){
- echo "Passwords did not match.";
- echo file_get_contents("insertpass.html");}
- elseif(!$uppercase || !$lowercase || !$number || strlen($pass) < 8) {
- echo "Error: Password did not match requirements";
- }
- else{
- $sql="UPDATE admin SET password = '$pass' WHERE username = 'admin'";
- if (!mysql_query($sql,$con))
- {die('Error: ' . mysql_error() ."<<");}
- echo "Password reset!";
- echo "<br /><a href=\"admin.php\">Proceed to the main admin menu</a>";
- echo "</html></body>";}
- mysql_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement