Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- session_start();
- if(isset($_SESSION['user'])!="")
- {
- header("Location: home.php");
- }
- include_once 'dbconnect.php';
- if(isset($_POST['submit'])){
- $email = $_POST['email'];
- $query = "SELECT user_email FROM users WHERE user_email='$email'";
- $result = mysql_query($query);
- $count = mysql_num_rows($result); // if email not found then register
- if($upass == $confPass){
- if($count == 1){
- ?>
- <script>alert('Success! Check your email for the link to reset your password.');</script>
- <?php
- $success = true;
- $to = $email;
- $from = 'noreply@failtastic.org';
- $subject = 'Signup | Verifictation';
- $message = '
- You are getting this email because you have forgotten your password, please click the link below to reset your password.
- -----------------------------
- Username: '.$user_name.'
- -----------------------------
- Please click this link to activate your account:
- http://www.failtastic.org/Login/verify.php?email='.$email.'&hash='.$hash.'
- Alternate link if that does not work:
- http://www.failtastic.fragcube.net/Login/verify.php?email='.$email.'&hash='.$hash.'
- ';
- $headers = 'noreply@failtastic.org' . "\r\n";
- mail($to, $subject, $message, $headers, $from);
- header("Location: index.php");
- }else{
- ?>
- <script>alert('Email does not exist!');</script>
- <?php
- }
- }
- }
- ?>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="forgot.css"/>
- </head>
- <body>
- <h1>Forgot Your Password</h1>
- <form method="post">
- <table>
- <tr>
- <td class="table">Email:<input type="email" name="email" placeholder="Email" required/></td>
- </tr>
- <tr>
- <td/>
- </tr>
- <tr>
- <td class="table"><button type="submit" name="submit">Send Email</button></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment