473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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.
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.

1 1284
Dormilich
8,658 Expert Mod 8TB
you cannot have 2 subsequent else clauses, only one else per if.
Sep 14 '14 #2

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

Similar topics

2
by: entoone | last post by:
I'm getting the following error Parse error: parse error, expecting `','' or `';'' in /home/notarywe/public_html/php/update2.php on line 108 Here is line 108 <input type="text" name="ud_first"...
4
by: Marcin Dobrucki | last post by:
I've been having some problems with a parse error that I can't figure out (PHP 4.3.11 on Solaris9). Sample code: <?php // getting strange parse errors on this class A { var $value; function...
2
by: urmyfriend | last post by:
Hi, I am getting the parse error while i try to execute a simple sql query in postgres. java.sql.SQLException: ERROR: parser: parse error at or near "and" at character 58 The Query has...
2
by: Sianaba | last post by:
I am getting help from a website to fix my malware etc problem.... i was instructed to run a Kaspersky scan and now when i try to get to my specific forum i get this come up instead: Parse error:...
2
by: DavidPr | last post by:
I'm getting - parse error, unexpected T_LNUMBER - error messages referring to the last "if" lines of this code. What I'm trying to do is check the database and if this user's article row isn't...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
15
by: micky125 | last post by:
Lo all, Ive been getting the error message Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/moneill/public_html/input.html...
45
by: angelicdevil | last post by:
i have 2 tables 1 is status_type with field name status and other is users with field username and status now i want that the first listbox lists all status from status type ( this i have achieved...
6
by: angelicdevil | last post by:
i m trying to display a message based on code status against the code in the database for on the code entered. however it gives me a parse error <?php require_once("includes/functions.php"); ?>...
12
by: Rana Chakra | last post by:
<?php $username="root"; $password=""; $database="lko_phone"; $host="localhost"; $msg=""; mysql_connect($host,$username,$password); @mysql_select_db($database); if($_SERVER == "POST")
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.