Jump to content
Larry Ullman's Book Forums

tonyscarpelli

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by tonyscarpelli

  1. If I entered the same new password as the old password, an error occurred that didn't inform the user of this. The following code can be changed as needed. CU

     

    I added the following code that checks for duplicate old and new passwords:

     

     

    //-------------------------------------------------------------------------

    // Check to see if password the same

    $q = "SELECT user_id FROM users WHERE (email='$e' AND pass=SHA1('$np') )";

    $r = @mysqli_query($dbc, $q);

    $num = @mysqli_num_rows($r);

    if ($num == 1) {

    //echo 'Not OK' . ' ' . $num; // for testing.

    $errors[] = 'Your new password is the same as your old password.';

    }

    //-------------------------------------------------------------------------

     

    if (empty($errors)) { // If everything's OK.

  2. I used the Chapter 11 book code last week in Xampp after installing Xampp and it worked.

     

    This week I tried it out and it didn't work.

     

    I rebooted and removed IIS which was on my computer, but that didn't work either.

     

    After doing a bit of debugging, it turned out that the Ajax status code was 0.

     

    I changed the test.js code so that it worked with a status = 0 ( || (ajax.status == 0) ). And now it works again.

     

    So what whould make the status code turn into 0 from last week?

     

    Or, in other words, what makes the ajax status equal 0 to begin with?

     

    Confusing...

     

    Thanks.

  3. Thanks HartleySan, I installed Xampp and worked my way through some install errors, but got it to work.

     

    I put the Ajax Test book code into the server and got it to work.

     

    I have a question about this, however.

     

    Do you guys edit your code outside Xampp and copy the code into it?

     

    Or do you edit the code inside the Xampp server?

     

    Thanks.

×
×
  • Create New...