Results 1 to 7 of 7

Thread: Day 17 - Include: Easy cut and paste for Programmers - Become PHP Expert in 30 days

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Nov 2004
    Location
    India
    Posts
    65

    Default

    http://php.flashwebhost.com/stefin/lost_password.php
    New Password send to your email

    This one was pretty good and interesting, i like copy pasting

    PHP Code:


    <?php
    include "includes/database.php";  

    if (isset(
    $_POST['email'])) {    $email = $_POST['email'];} else {    die('Please enter your email address');}
    $email = trim($email);


    $sql = "select * from users where email='$email'";
    $result = $mysqli->query($sql);

    if (
    $result->num_rows == 0) {    die("User with email address <b>$email</b> not found");}
    $userInfo = mysqli_fetch_assoc($result);
    $name = $userInfo['name'];$password = $userInfo['password'];mail($email,"Your password", "Hello $name, your password is $password");
    echo 
    'New Password send to your email';
    Last edited by stefin; 08-03-2014 at 02:29 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •