Getting parse error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SamDave
    New Member
    • Sep 2014
    • 5

    Getting parse error

    Am trying to write a certain code but i am getting Parse error: syntax error, unexpected T_ELSE in/home/a7677023/public_html/learning/php&html/trial01.php

    I am new in php. . . I need someone to help.
    Code:
     <?PHP
    if (isset($_POST['submit1'])) { $clear = $_POST['john']; $black = $_POST['paul'];
    
    if ($clear == $_POST['john']) { print($clear); 
    }
    else {print ("Unknown Keyword"); }
    }
    else {$clear = "" ; 
    }
    if ($black == $_POST['paul']) {print ($black); }
    else {print ("UNKNOWN ENTRY"); }
    else {$black = ""; }
    ?>
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you cannot have 2 subsequent else clauses, only one else per if.

    Comment

    Working...