Having problem in forget password page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chaos
    New Member
    • Jun 2007
    • 52

    Having problem in forget password page

    Hi all , i occur a problem in my forget password page as the page appear as blank page . Can anyone help me find out wt went wrong with my code.
    [CODE=php]
    <?php require_once('C onnections/conn.php'); ?>
    <?php
    session_start() ;
    $PasswordFormAc tion = $_SERVER['PHP_SELF'];
    if (isset($accessc heck)) {
    $GLOBALS['session'] = $accesscheck;
    session_registe r('session');
    }
    if (!isset($_POST['email'])){
    $email_address = $_POST['email'];
    }
    else {
    $email_address= mysql_real_esca pe_string($emai l_address);
    $status = "OK";
    $msg="";

    if (!stristr($emai l_address,"@") OR !stristr($email _address,".")) {
    $msg="Your email address is not correct<BR>";
    $status= "NOTOK";}

    echo "<br><br>";
    if($status=="OK "){
    $query="SELECT email_address,u sername FROM user_profile WHERE email= '$email_address '";
    $st=mysql_query ($query, $conn) or die(mysql_error ());
    $recs=mysql_num _rows($st);
    $row=mysql_fetc h_object($st);
    $em=$row->email_addres s;

    if($recs == 0){
    print "We're sorry, your Email does not appear to be in our database.";
    }
    else {


    $resultID ="SELECT password FROM user_profile WHERE email = '$email'";
    $st2=mysql_quer y($resultID, $conn) or die(mysql_error ());
    $recs2=mysql_nu m_rows($st2)
    $row2 = mysql_fetch_arr ay($st2);
    $passwordfromdb = $row2[0];

    // End of query commands
    // Send Password to email

    mail($email, "Your Password", "Password: $passwordfromdb ", "FROM: fyp@.com");
    echo "Your Password has been sent to $email ";
    ?>
    ?>
    [/CODE]
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    There MUST not be any output (or whitespace) before session_start() . Start your file as follows

    [PHP]<?php require_once('C onnections/conn.php');
    session_start() ;
    //rest of your code....
    [/PHP]

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, chaos.

      Thanks for using CODE tags! Did you know that you can specify a language for your CODE tags to make your source code easier to read?

      You will still need to use [/CODE] to close your code blocks, regardless of the language, but you can the use one of these tags to open your code block:

      [CODE=html]
      [CODE=javascript]
      [CODE=php]

      and so on.

      Thanks!

      MODERATOR

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, chaos.

        A blank page usually means that your script generated an error.

        Check out this article for more information.

        Comment

        • chaos
          New Member
          • Jun 2007
          • 52

          #5
          thx pbmods for your help!!!

          Comment

          Working...