Hello i have been working for hours to make this script working. I want it check so the username, name, mail and code is true. If all is true it will show the password from the user and if not it will show a message like Something is wrong!
This is the script
This is the errors
This is the script
PHP:
<b>Forgot Password</b>
<?php
if (isset($_POST['submit'])){
$user = $_POST['user'];
$email = $_POST['email'];
$name = $_POST['name'];
$code = $_POST['code'];
$pass = $_GET['pass'];
$sql = "SELECT * FROM users WHERE email='$email' AND name='$name' AND code='$code' AND
user='$user' AND pass='$pass'";
if(!mysql_query($sql))
{
echo "Något är fel! ".mysql_error();
}
else
{
echo "Your Password is ".$pass."!";
}}
?>
<html>
<body>
<tr>
<form action="?p=lostpassword" method="post">
<td><br>Username:<br></td>
<td><input type="text" input type="text" name="user" value=""></td>
</tr>
<tr>
<td><br>Mail:<br></td>
<td><input type="text" name="email" value=""></td>
</tr>
<tr>
<td><br>Name:<br></td>
<td><input type="text" name="name" value=""></td>
</tr>
<tr>
<td><br>Secret Code:<br></td>
<td><input type="text" name="code" value=""></td>
</tr>
<tr>
<td>
<tr>
<br>
<input type="submit" name="submit" value="Get Password">
</td>
</tr>
</table>
</form>
<br>
<br>
</html>
</body>
This is the errors
PHP:
Notice: Undefined index: pass in C:\xampp\htdocs\pages\lostpassword.php on line 8
Your Password is !