Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default help me again pls.

    PHP Code:
    <?
    include('config.php');
    if (!
    $_POST[submit])

    {
    ?>
    <form name="form1" method="post" action="">
      <p><font face='Verdana' size='1'><b>
    Forgotten Password</b><br /><br /><font face='Verdana' size='1'>
    If you have forgotten your Password, you may enter your Username below and you will be sent an Email containing details on how to reset it..<br /><br />
        <b>Username;</b><br />
          <input name="username" type="text" id="username">
        <br />
        <br />
        <input type="submit" name="submit" value="Recover Password">
    </p>
      </form><br />
    <font face='Verdana' size='1'>+ <a href='login.php' style='text-decoration: none'>Back to Main Page</a>
    <?
    }
    else
    {
    ?>
    <?
    $username 
    $_POST[username];
    $username htmlspecialchars($username);
    $code=rand(151343,18618774);

    $query mysql_query("INSERT INTO forgotpw (username, code) VALUES('$username','$code')");
    $getemail MYSQL_QUERY("SELECT * email from users WHERE username='$username'"); 

    $sitename 'PixelResources';
    $subject 'PixelResources Members System - Password Recovery';
    $message 'Hello.. <br>
    Please visit the URL below and type in the Validation Code on the page you end up at;<br><br>
    http://www.yoursite.com/passcode.php<br><br>
    Your Validation Code Is; $code <br><br>
    Thankyou.. PixelResources.. '
    ;

    $headers 'From: $sitename' "\r\n" .

    mail($getemail$subject$message$headers);
    echo(
    '<font face="verdana" size="1"><b>Thankyou</b><br /><br />An Email has been dispatched to the Email registered with the account with details on how to reset the Password.. <br /><br />+ <a href="passcode.php" style="text-decoration: none">Proceed to Step 2</a><br />+ <a href="login.php" style="text-decoration: none">Main Page</a>'); 

    ?>
    <?
    }
    ?>
    for some reason once you typed in your username you dont recieve an email?

  2. #2
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    whats the adress there receiving the email from?

  3. #3
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    Well im testing it and i dont get the email ;S

  4. #4
    Join Date
    Feb 2005
    Location
    Leicestershire / Sheffield
    Posts
    685
    Tokens
    0

    Default

    Im bored...

    PHP Code:
    <?
    include('config.php');
    if (!
    $_POST[submit])

    {
    ?>
    <form name="form1" method="post" action="">
      <p><font face='Verdana' size='1'><b>
    Forgotten Password</b><br /><br /><font face='Verdana' size='1'>
    If you have forgotten your Password, you may enter your Username below and you will be sent an Email containing details on how to reset it..<br /><br />
        <b>Username;</b><br />
          <input name="username" type="text" id="username">
        <br />
        <br />
        <input type="submit" name="submit" value="Recover Password">
    </p>
      </form><br />
    <font face='Verdana' size='1'>+ <a href='login.php' style='text-decoration: none'>Back to Main Page</a>
    <?
    }
    else
    {
    ?>
    <?
    $username 
    $_POST[username];
    $username htmlspecialchars($username);
    $code=rand(151343,18618774);

    $query mysql_query("INSERT INTO forgotpw (username, code) VALUES('$username','$code')");
    $query2 mysql_query("SELECT * FROM `users` WHERE `username` = '$username'"); 
    $row mysql_fetch_array($query2);
    $getemail  $row['email'];

    $sitename 'PixelResources';
    $subject 'PixelResources Members System - Password Recovery';
    $message 'Hello.. <br>
    Please visit the URL below and type in the Validation Code on the page you end up at;<br><br>
    http://www.yoursite.com/passcode.php<br><br>
    Your Validation Code Is; $code <br><br>
    Thankyou.. PixelResources.. '
    ;

    $headers 'From: $sitename' "\r\n" .

    mail($getemail$subject$message$headers);
    echo(
    '<font face="verdana" size="1"><b>Thankyou</b><br /><br />An Email has been dispatched to the Email registered with the account with details on how to reset the Password.. <br /><br />+ <a href="passcode.php" style="text-decoration: none">Proceed to Step 2</a><br />+ <a href="login.php" style="text-decoration: none">Main Page</a>'); 
    }
    ?>
    -Eric

  5. #5
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    thanks eric, another problem though when i get the email the $code actually comes through as '$code'

  6. #6
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by PixelResources View Post
    thanks eric, another problem though when i get the email the $code actually comes through as '$code'
    becuse hes useing single quotes and not breaking the php

    PHP Code:
    <?
    include('config.php');
    if (!
    $_POST[submit])

    {
    ?>
    <form name="form1" method="post" action="">
      <p><font face='Verdana' size='1'><b>
    Forgotten Password</b><br /><br /><font face='Verdana' size='1'>
    If you have forgotten your Password, you may enter your Username below and you will be sent an Email containing details on how to reset it..<br /><br />
        <b>Username;</b><br />
          <input name="username" type="text" id="username">
        <br />
        <br />
        <input type="submit" name="submit" value="Recover Password">
    </p>
      </form><br />
    <font face='Verdana' size='1'>+ <a href='login.php' style='text-decoration: none'>Back to Main Page</a>
    <?
    }
    else
    {
    ?>
    <?
    $username 
    $_POST[username];
    $username htmlspecialchars($username);
    $code=rand(151343,18618774);

    $query mysql_query("INSERT INTO forgotpw (username, code) VALUES('$username','$code')");
    $query2 mysql_query("SELECT * FROM `users` WHERE `username` = '$username'"); 
    $row mysql_fetch_array($query2);
    $getemail  $row['email'];

    $sitename 'PixelResources';
    $subject 'PixelResources Members System - Password Recovery';
    $message 'Hello.. <br>
    Please visit the URL below and type in the Validation Code on the page you end up at;<br><br>
    http://www.yoursite.com/passcode.php<br><br>
    Your Validation Code Is; '
    .$code.' <br><br>
    Thankyou.. PixelResources.. '
    ;

    $headers 'From: $sitename' "\r\n" .

    mail($getemail$subject$message$headers);
    echo(
    '<font face="verdana" size="1"><b>Thankyou</b><br /><br />An Email has been dispatched to the Email registered with the account with details on how to reset the Password.. <br /><br />+ <a href="passcode.php" style="text-decoration: none">Proceed to Step 2</a><br />+ <a href="login.php" style="text-decoration: none">Main Page</a>'); 
    }
    ?>
    -possibly the smallest update to need a full repost of the code.

    If your gona have a php site maybe you should learn php? even if just the basics to fix simple mistakes like that one "/

  7. #7
    Join Date
    Feb 2005
    Location
    Leicestershire / Sheffield
    Posts
    685
    Tokens
    0

    Default

    Didnt see that $code there

  8. #8
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    Grrrr now need more help.. When i type in the code it says incorrect ;s

  9. #9
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    php.net..

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  10. #10
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    already tryed php.net didnt help me ;s

Page 1 of 2 12 LastLast

Posting Permissions

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