A Few Technical Difficulties - Page 2
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21

Thread: A Few Technical Difficulties

  1. #16
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,851
    Oh, now another problem....that certainly makes things easier for other users who are searching the forums - almost as much as the thread title does. Well:

    • item 1 of bradgrafelman's post #4 still applies.


    • Also, you're trying to compare a string ($_POST['password']) against a resource ($f).


    • Also, all this
      PHP Code:
          $bInputFlag false;
          foreach ( 
      $_POST as $field )
              {
              if (
      $field == "")
                  {
                  
      $bInputFlag false;
                     }
              else
                    {
                  
      $bInputFlag true;
                     }
              }
          
      // If we had problems with the input, exit with error
          
      if ($bInputFlag == false)
              {
              die(
      "Uh Oh. Problemo. There was a problem with your new password. Please go back and try again.");
              } 
      is a roundabout way of saying
      PHP Code:
      if(in_array(""$_POST))
      {
          die(
      "Uh Oh. Problemo. There was a problem with your new password. Please go back and try again.");



    • Also, handling user errors by writing a message with die is like screaming at the user to get out, bundling them out the door, slamming it in their face, and sticking up a "CLOSED" sign. I've seen it called Soup Nazi style.
    Last edited by Weedpacket; 04-16-2012 at 10:38 PM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  2. #17
    Member
    Join Date
    Apr 2012
    Posts
    33
    So, what do you think is the best way to check if the user's username matches the one in the database?

  3. #18
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,851
    Look at the username supplied by the user, look at the value in the database. If they're the same, then they match.....
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  4. #19
    Senior Member
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    753
    It just takes a little bit pf practice, very soon you'll be making less and less mistakes. One thing I find very helpful is an editor with syntax highlighting, so something like Notepad++ or Kate are very good, and they support multiple languages.
    Ashley Sheridan
    www.ashleysheridan.co.uk

  5. #20
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,767
    Speaking of editors - Komodo Edit is free and provides lint in the software. No need to save, switch to browser / cli and run it to get parse errors. You'll get them right in the editor.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  6. #21
    Senior Member anoopmail's Avatar
    Join Date
    May 2005
    Location
    Hell
    Posts
    241
    var_dump($field) in the loop and debug it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •