No, two is a more accurate comparison.
!==
Although for most cases != is sufficient.
""Richard S. Crawford"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> use just one = sign. So,
>
> if ($PASS != $PASSNOG) {...
>
>
> At 01:41 AM 3/15/01 +0100, Duky wrote:
>
use just one = sign. So,
if ($PASS != $PASSNOG) {...
At 01:41 AM 3/15/01 +0100, Duky wrote:
>Hmm.. maybe I wasn't clear enough... what I want is to check is WHEN the
>two passwords aren't the same, then it should echo "password doesn't
>match!". So when NOT the same, then echo. What to use for
Hmm.. maybe I wasn't clear enough... what I want is to check is WHEN the
two passwords aren't the same, then it should echo "password doesn't
match!". So when NOT the same, then echo. What to use for the NOT??
should it then be something like this with the exlamationmark?
if ($PASS !== $P
even better to use:
echo("\$PASS = $PASS\$PASSNOG = $PASSNOG");
which will show the variable name whether it has anything defined or not.
Terry
On Wednesday, March 14, 2001, at 03:21 PM, Ivo Stoykov wrote:
> Hi Duky
>
> Try to add this before if statement
>echo("$PASS$PASSNOG");
At 10:21 PM 3/14/2001 +0100, Ivo Stoykov wrote:
>Try to add this before if statement
>echo("$PASS$PASSNOG");
A more accurate way to tell this would be to do the following:
echo "\"".$PASS."\",\"",$PASSNOG,"\"\n";
This was you will see embedded spaces and carriage returns which will not
be
Hi Duky
Try to add this before if statement
echo("$PASS$PASSNOG");
it will show you whether your vars are correct and whether there is
something in at all!
if ($PASS != $PASSNOG) {
echo "password doesn't match! $back";
exit;
}
Good luck
Ivo
"Duky" <[EMAIL PROTECTED]> w
The variables are the right ones...
"Fabio Ottolini (EDB)" wrote:
>
> Duky,
>
> Did you check if you have named correctly your variables in your form? Your
>statement is more than corret. Try "echoing" your variables before making the
>comparision to verify if they are set. If not probabily y
Duky,
Did you check if you have named correctly your variables in your form? Your statement
is more than corret. Try "echoing" your variables before making the comparision to
verify if they are set. If not probabily you have a spelling problem on the form
variables.
BR,
Fábio Ottolini
P.S.:
Ànd what statement for not matching? this maybe?
if ($PASS !== $PASSNOG) {
# do whatever.
}
Duky
Duky wrote:
>
> Can somebody tell me what the proper statement is for this? I want two
> variables to match with eachother but this doesn't seems to work. Help
> please? THNX
>
>if
I'm assuming these are strings you are comparing, correct? If so, try this:
if(strcmp($PASS, $PASSNOG))
{
echo "password doesn't match! $back";
exit;
}
http://www.php.net/manual/en/function.strcmp.php
Josh Hoover
KnowledgeStorm, Inc.
[EMAIL PROTECTED]
Searching for a new IT s
Duky,
Have you tried to use:
if ($PASS == $PASSNOG) {
# do whatever.
}
If you're taking data from a form, you might want to do a trim to remove any
trailing spaces
if ($PASS == trim($PASSNOG)) {
# do whatever
}
There's also...
http://www.php.net/manual/en/function.str
11 matches
Mail list logo