note 27443 deleted from function.strcasecmp by nlopess
| From: | nlopess@php.net | Date: | Thu, 12 Aug 2004 21:17:37 +0000 |
| Subject: | note 27443 deleted from function.strcasecmp by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74561@lists.php.net to get a copy of this message | ||
Note Submitter: richard@richard-sumilang.com
----
Just a note
----------------------------------
The returns on the function aren't like most returns, kinda strage.
Here's my example on a non case sensative password test
<?
/*
Normally by looking at the code below it will seem that
it should return 1 or true but since it functions a little
different, 0 is good and 1 is bad :-\ .... So anyways, heres
the following code on some cheesy password example assuming
the password came from a form
*/
// Check if password matches, if it doesnt send to error page
if(strcasecmp("password", $_POST['password'])){
header("Location: error.php?e=bad_password");
exit();
}
?>
Hope this helps someone