By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,132 Members | 1,299 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,132 IT Pros & Developers. It's quick & easy.

Having problem in forget password page

P: 52
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.
Expand|Select|Wrap|Line Numbers
  1. <?php require_once('Connections/conn.php'); ?>
  2. <?php
  3.     session_start(); 
  4.     $PasswordFormAction = $_SERVER['PHP_SELF'];
  5.     if (isset($accesscheck)) {
  6.       $GLOBALS['session'] = $accesscheck;
  7.       session_register('session');
  8.     }
  9.     if (!isset($_POST['email'])){
  10.     $email_address = $_POST['email'];
  11.     }
  12.     else {
  13.     $email_address=mysql_real_escape_string($email_address);
  14.     $status = "OK";
  15.     $msg="";
  16.  
  17.     if (!stristr($email_address,"@") OR !stristr($email_address,".")) {
  18.     $msg="Your email address is not correct<BR>"; 
  19.     $status= "NOTOK";}
  20.  
  21.     echo "<br><br>";
  22.     if($status=="OK"){  
  23.     $query="SELECT email_address,username FROM user_profile WHERE email= '$email_address'";
  24.     $st=mysql_query($query, $conn) or die(mysql_error());
  25.     $recs=mysql_num_rows($st);
  26.     $row=mysql_fetch_object($st);
  27.     $em=$row->email_address;
  28.  
  29. if($recs == 0){
  30.     print "We're sorry, your Email does not appear to be in our database.";
  31.         }
  32.         else {
  33.  
  34.  
  35. $resultID ="SELECT password FROM user_profile WHERE email = '$email'";
  36. $st2=mysql_query($resultID, $conn) or die(mysql_error());
  37. $recs2=mysql_num_rows($st2)
  38. $row2 = mysql_fetch_array($st2);
  39. $passwordfromdb = $row2[0];
  40.  
  41. // End of query commands
  42. // Send Password to email
  43.  
  44. mail($email, "Your Password", "Password: $passwordfromdb", "FROM: fyp@.com");
  45. echo "Your Password has been sent to $email ";
  46.     ?>
  47. ?>
  48.  
Jul 8 '07 #1
Share this Question
Share on Google+
4 Replies


mwasif
Expert 100+
P: 801
There MUST not be any output (or whitespace) before session_start(). Start your file as follows

[PHP]<?php require_once('Connections/conn.php');
session_start();
//rest of your code....
[/PHP]
Jul 8 '07 #2

pbmods
Expert 5K+
P: 5,821
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
Jul 8 '07 #3

pbmods
Expert 5K+
P: 5,821
Heya, chaos.

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

Check out this article for more information.
Jul 8 '07 #4

P: 52
thx pbmods for your help!!!
Jul 8 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.