Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logical Operator problem 1

Status
Not open for further replies.

lanm

Programmer
Jul 7, 2005
244
US
I have the following and get the error:
Parse error: syntax error, unexpected T_IF in C:\ on line 82

I know I can verify the IDNumber, but now when I'm trying to also validate the password the user enters, I get the syntax error above.


<?PHP
if (isset($_POST['IDnumber'])) {
$IDFound = "This is a valid Number";
$IDNotFound = "This is not a valid Number";
$Password = "TestPwd"
If ($totalRows_Recordset2==1 AND $_POST['Password']==$Password)
{echo $IDFound;}
Else
{echo $IDNotFound;}
}
?>
 
When PHP gives you a "parse error on line x", that means that line x in your script is the line where PHP realized it was confused by your script. It is not necessarily the line where the error actually is.

In general, start at line x and work your way backward. Doing that on your code finds this line:

$Password = "TestPwd"

Which should read:

$Password = "TestPwd"[red];[/red]


See also faq434-2999


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks sleipnir214, that was it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top