• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 21. JavaScript Project: Setting ... > Solving the "404 Not Found" Problem

Solving the "404 Not Found" Problem

The biggest problem with the scripts in Listings 21.4 and 21.5 is that if the user enters an incorrect password, the code still attempts to send the user to the address given by user_password + ".htm". Since this address isn't likely to correspond to any existing file, the server will ship out a 404 Not Found error. This is not only ugly, but it also might confuse the user because he might think that he has the wrong password or that there's some kind of problem on the server.

Alternatively, the user might enter the wrong password that does correspond to an existing file in the directory. In this case he'd see that file displayed in his browser, which might again lead to confusion.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint