Jump to content

djw821

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

djw821's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I made the changes but still have the same error.
  2. The Exact Error message I am getting is this Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\htdocs\forgot password.php on line 71 Entire section of code is this I have put an ** on line 71. if($un){ //Create a new random password $p = substr( md5(uniqid(rand(),1)), 3, 10); ** $query = "UPDATE registration SET password=PASSWORD('$p') WHERE user_id = $uid"; $result = @mysql_query ($query); if(mysql_affected_rows()==1) { //Send Email $body = "Your password has been temporarily changed to '$p'Please log in using this password and your username. At that time you may change your password to something you can remember."; mail($email, Your Temporary Password. ', $body 'From: admin@'); echo'<h3>Your password has been changed you will receive a new, temporary password at the email address you provided when you registered. Once you logged in with this password, you may change it by clicking the "Change Password" link.</h3>'; exit(); }else{ //Send message to error log $message = '<p><font color="yellow" size="+1">Your password could not be changed due to a system error. We apologize for any inconvenience.</font></p>'; } mysql_close(); }else{ echo '<p><font color="yellow" size = "+1">Please try again</font></p>'; } } ?>
  3. What follows the if is this //Send Email $body = "Your password has been temporarily changed to '$p' Please log in using this password and your username.
  4. I keep getting a parse error on this section of code but I can't seem to find it. I was hoping someone could see something I missed. Thanks //Create a new random password $p = substr( md5(uniqid(rand(),1)), 3, 10); $query = "UPDATE registration SET password=PASSWORD('$p') WHERE user_id = $uid"; $result = @mysql_query ($query); if(mysql_affected_rows()==1)
  5. I have a standard html registation form page I send the form information to a seperate PHP page for checking and sending to the MySQL Database. Everything works great. If there is an error or a blank field a different page opens with the error message like That username is already in use. What I would like to do is instead of having a different page open I would like to send the error messages back to the html page so that it would appear on the same page as the form. I have no idea how to do this in PHP. Can anyone help me?
  6. What I was doing worng was this: 1 2<?php ob_start; when I change it to 1<?php ob_start; it worked I just needed to mover the ob_start to the very top of the page even though there was nothing there.
  7. I got this figured out thanks for all your help
  8. Here is the section of code. $query = "SELECT user_id, first_name FROM registration WHERE user_name ='$un' AND password=PASSWORD('$p')"; $result = @mysql_query ($query); $row = mysql_fetch_array ($result, MYSQL_NUM); if($row) { header('Location: Members.htm'); exit(); }else{ print '<p><font color = "red" size = "+1">The Username and Password do not match those on file.</font></p>'; } ob_end_clean(); mysql_close();
  9. I turned on my error reporting and took care of the output buffering issue but still come to a plain white screen. With no errors.
  10. I turned my notices on and I got an output buffering error I will work on that and see what happens, Thanks
  11. I am trying to redirect from my login script to my members page. I can't seem to do it. I use this code if($row) { header('Location: Members.htm'); exit(); }else{ print '<p><font color = "red" size = "+1">The Username and Password do not match those on file.</font></p>'; If I subsitute the header function for a print function ex if($row{ print '<p>SUCCESS</p>'; It will work so I am pretty sure that $row is correct. But if I use the header function I get a blank white screen no error messages or anything. Can some one help me? Thanks
  12. I have created two forms one as a registration for which inserts user data into MySQL database and one as a login form to query and match the data for login. The problem I have is that I can't seem to match the user_name and password when I try to use the login form. I am Absolutley certain that I am using the same username and passowrd as I used on the registration form. Here is my code for inserting the data into the MySQL database. $query = "SELECT user_id FROM registration WHERE user_name='$un'"; $result = @mysql_query ($query); // Run The Query. if(mysql_num_rows($result) == 0) { //Make the Query $query = "INSERT INTO registration (first_name, last_name, email, user_name, password) VALUES('$fn', '$ln', '$e', '$un', PASSWORD('$p'))"; $result = @mysql_query($query); // Run the query. Here it is for the login form $query = "SELECT user_id, first_name FROM registration WHERE user_name ='$un' AND password=PASSWORD('$p')"; $result = @mysql_query ($query); $row = mysql_fetch_array ($result, MYSQL_NUM); But I keep getting the message that The username and password do not match those on file and I am certain that I am usign the same ones. Can someone please help me.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.