473,803 Members | 3,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having problem in forget password page

52 New Member
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
4 1454
mwasif
802 Recognized Expert Contributor
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]
Jul 8 '07 #2
pbmods
5,821 Recognized Expert Expert
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
5,821 Recognized Expert Expert
Heya, chaos.

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

Check out this article for more information.
Jul 8 '07 #4
chaos
52 New Member
thx pbmods for your help!!!
Jul 8 '07 #5

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

Similar topics

4
1238
by: wASP | last post by:
Hi, I'm a newbie starting up with ASP.NET, and I'm getting off to a wonderful start - and when I tell you "wonderful" I'm being sarcastic. My OS is Win 2000 SP4. I've gotten IIS installed, along with the .NET framework.
1
4510
by: Andrea | last post by:
Hi, i've installed OCS Inventory NG for inventory and it has installed Mysql ver: mysql Ver 14.12 Distrib 5.0.18, for Win32 now i have to make a dump for save database but don't forget the root password. I've try to reset password with resetpassword.bat and also with this
2
1166
by: brett | last post by:
I'm using ASP.NET 2.0 with roles/memberships. I have one page with these controls: - Login - PasswordRecovery - CreateUserWizard After creating a user, I try to login but get an error saying the attempt was not successful. After a few tries, I try the password recovery. It sends me a password, which I try. I get the same message
52
5138
by: bb nicole | last post by:
Below is my forget password, why cannot function?? When i click on the submit button, it still remain on the same page and just like i didn't click anything... <?php if($go == "1") { mysql_connect("localhost","root",""); mysql_select_db("ums e-job portal"); $sql = @mysql_query("SELECT * FROM company WHERE username='$username' && emailAdd='$email' "); if(!$sql)
0
1083
by: =?Utf-8?B?QW1qYWQ=?= | last post by:
I have one question about forget password control with asp.net 2.0 we are using here Groupwise . how can i send email using group wise instead of SMPT and how to change the setting for or i have to write my own controller instead of using micrsoft one for forget password thanks
3
5046
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post by:
Hi, we've got a strange problem here: We've created an ASP.NET 2.0 web application using Membership.ValidateUser() to manually authenticate users with our website. The problem is: If the user has the "User must change password" flag set in Active Directory, ValidateUser() always returns false if that user wants to log in.
2
3584
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in uby/Rails. I started it in Perl and gave up on Perl as I went from the 'display the database information on the web page' to the 're-display the information from the database and allow the user to update the database using the web page' stage and realized...
2
1794
harshadd
by: harshadd | last post by:
I have 3000+ exchange users and most of the time they forget the password and we reset it for them. again problem is this happens on phone. so no guaranty that user it self has requested to change/reset the password. Can any one know if it is possible on MS Exchange, to reset the users email password using some thing like "Forget Password wizard" as we do on yahoo/gmail/hotmail etc. where user has to answer some secret question and will reset...
3
1613
by: dxting | last post by:
Hi Can anyone tell me how to write the forget password function in my web page.My web page haven't publish yet. Just using it as local host. Means don't have domain yet.
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.