Jump to content

ashleysmithd

Members
  • Posts

    11
  • Joined

  • Last visited

ashleysmithd's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I tried a few simpler options but was still getting issues (if statements not working as expected), the simplified solution you posted works fine though. Thanks again.
  2. Many thanks, works now. Used:<?$incorrectpwd = NULL;if (isset($_GET['pass'])) {$incorrectpwd = $_GET['pass'];} if ($incorrectpwd != NULL) {echo "<b><font color=red>Incorrect password</b></font>"; }?>
  3. Hi, I'm trying to achieve a basic function within a login system, whereby a user enters a wrong username and/or password, is returned back to the login screen where a message flagging 'incorrect password' is shown. The login system works and upon input of an incorrect username and/or password the user is taken back to the login screen, and a URL variable is passed called '?pass=bad'. The issue I'm encountering is that the variable 'pass' does not exist in the URL by default (and I'd rather it didn't), therefore whenever the page checks to see if 'pass' equals 'bad' I get an 'Undefined Index' error, unless, the user has typed in a wrong username/password in which case the variable 'pass' exists and it has no problem handling it. What I think I need to do is tell PHP to ignore that variable if it does not exist. I've tried if statements but as they still look for a variable that does not exist, I still get an error. Can anyone offer any advice on the issue? Thanks in advance. Example of the code I'm using: <?if ($_GET['pass'] != NULL) {$incorrectpwd = 1; } else { $incorrectpwd = 0; } if ($incorrectpwd == 1) {echo "<b><font color=red>Incorrect password</b></font>"; } ?>
×
×
  • Create New...