423,311 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,311 IT Pros & Developers. It's quick & easy.

Getting parse error

P: 5
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.
Expand|Select|Wrap|Line Numbers
  1.  <?PHP
  2. if (isset($_POST['submit1'])) { $clear = $_POST['john']; $black = $_POST['paul'];
  3.  
  4. if ($clear == $_POST['john']) { print($clear); 
  5. }
  6. else {print ("Unknown Keyword"); }
  7. }
  8. else {$clear = "" ; 
  9. }
  10. if ($black == $_POST['paul']) {print ($black); }
  11. else {print ("UNKNOWN ENTRY"); }
  12. else {$black = ""; }
  13. ?>
Sep 13 '14 #1

✓ answered by Dormilich

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

Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
you cannot have 2 subsequent else clauses, only one else per if.
Sep 14 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.