Jump to content

forget password, send password to gmail


vermouth

Recommended Posts

<center><h2>Forget Password ?</h2></center><br/>

        

            <center><table border="0" cellpadding="10">
    </head>
                <tr>
                    <td>Username</td>
                    <td><input type="text" name="username" /></td>
                </tr>
                <tr>
                    <td>Email</td>
                    <td><input type="text" name="email" /></td>
                </tr>
               
            </table>

            <div class="form-actions">

                <input type="submit" class="btn btn-primary" value="Reset" />

            </div>

            <?php if( isset($info)): ?>

                <div class="alert alert-success">

                    <?php echo($info) ?>

                </div>

            <?php elseif( isset($error)): ?>

                <div class="alert alert-error">

                    <?php echo($error) ?>

                </div>

            <?php endif; ?>

            

        </fieldset>

    </form>

</div>
    </body>
</html>

Link to comment
Share on other sites

<?php
    function doforget()

{

    $this->load->helper('url');

    $email= $_POST['email'];

    $q = $this->db->query("select * from users where email='" . $email . "'");

    if ($q->num_rows > 0) {

        $r = $q->result();

        $user=$r[0];

        $this->resetpassword($user);

        $info= "Password has been reset and has been sent to email id: ". $email;

        redirect('/index.php/login/forget?info=' . $info, 'refresh');

    }

    $error= "The email id you entered not found on our database ";

    redirect('/index.php/login/forget?error=' . $error, 'refresh');
}
       
 ?>

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <p>
            <?php
            echo "<br/>";
            ?>
            <a href="index.php">Home</a>
        </p>
       
       
    </body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.