Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
change password script not working
Old 04-09-2010, 04:06 PM change password script not working
Webmaster Talker

Posts: 611
Trades: 0
hi, i have a change password script that is giving me an error when i submit the email and password and hit submit. any help is GREATLY appreciated. here is the error i get

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/passrecovery8.php on line 38

That email does not exist in the database



and here is the code to my page

Code:
<?php
include("connect1.php");

ini_set('display_errors', 1);
  error_reporting(E_ALL);   // GREAT SNIPPET FOR DEBUGGING OUTPUTS ERRORS TO SCREEN */

    if (isset($_POST['email']) && isset($_POST['Password']) && isset($_POST['Confirm']))
    {

       // Declare Variables
        $email = mysql_real_escape_string($_POST['email']);
        $Password = mysql_real_escape_string($_POST['Password']);
        $Confirm = mysql_real_escape_string($_POST['Confirm']);

        // Encrypt passwords with md5 encryption
        $Password = md5($Password);
        $Confirm = md5($Confirm);

        if($Password != $Confirm)
        {
        echo "<br>The two passwords did not match<br>";
         echo "Please enter your email: <form action=\"passrecovery8.php\" method=\"POST\"   >
<input type=\email\" name=\"email\"><br>
<br>
 <br><br><br>Please enter your new password:<br>
<input type=\"password\" name=\"Password\"><br>
<br>
Please Confirm that new Password:<br>
 
<input type=\"password\" name=\"Confirm\"><br>
<br><input type=\"submit\" value=\"Set Password\"</form>";
         exit;
        }

      // Check if the email already exists in database
       
      $query = "SELECT * FROM members_videos WHERE Email = '$email' ";
      $results = mysql_num_rows(mysql_query($query));
     
       
      
      if ($results > 0)
      {

          // Insert information to the database
          mysql_query("UPDATE members_videos SET Password='$Password' WHERE Email='$email'");

          //Send them to login
          header("Location:http://oldmastercopies.com/success.html");
      }
      else
      {
          echo "<br>That email does not exist in the database<br>";
      }
 }
    else 
    {
        // Displaying Forms
        echo "Please enter your email: <form action=\"passrecovery8.php\" method=\"POST\">
            <input type=\"text\" name=\"email\"><br>
            <br>
             <br><br>Please enter your new password:<br>
            <input type=\"password\" name=\"Password\"><br>
            <br>
            Please Confirm that new Password:<br>
         
        <input type=\"password\" name=\"Confirm\"><br>
            <br><input type=\"submit\" value=\"Set Password\"></form>";
    }

?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reset Password Page</title>
</head>

<body>
</body>
</html>
silverglade is offline
View Public Profile
 
 
Register now for full access!
Old 04-09-2010, 05:06 PM Re: change password script not working
Webmaster Talker

Posts: 611
Trades: 0
sweweeeet. I GOT IT TO WORK! THANKS. DEREK
silverglade is offline
View Public Profile
 
Closed Thread     « Reply to change password script not working
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10787 seconds with 12 queries