943,078 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 315
  • PHP RSS
Mar 21st, 2010
0

not getting what the error is everythin looks perfect to me

Expand Post »
PHP Syntax (Toggle Plain Text)
  1. foreach($routearr as $value)
  2. {
  3. if($value==(change here at kashmere gate ) || $value==(change here at rajiv chowk ) || $value==(change here at yamuna bank ) )
  4. {
  5. echo "<br>";
  6. echo "<div style=\"color:#8e0b0b\" > $value</div>";
  7. }
  8. else
  9. echo "<span style = \"color:#f80a0a\" >$value</span>";
}
in above code line 3 gives this error Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\knowdelhi\metro\metrosubmit.php on line 2009
line 2009 in the error is line three here.when i comment out this piece of code everything works ok but when i remove the above code form comments the error again creeps in so error must be in above code..but it looks ok to me...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mayanktalwar is offline Offline
16 posts
since Aug 2009
Mar 21st, 2010
0
Re: not getting what the error is everythin looks perfect to me
PHP Syntax (Toggle Plain Text)
  1. if($value==(change here at kashmere gate ) || $value==(change here at rajiv chowk ) || $value==(change here at yamuna bank ) )

Is that your exact code? If it is, what does "change here at kashmere gate" mean? If it is supposed to be a string, enclose it in quote marks.
Reputation Points: 395
Solved Threads: 192
Veteran Poster
darkagn is offline Offline
1,136 posts
since Aug 2007
Mar 21st, 2010
0
Re: not getting what the error is everythin looks perfect to me
thanks yes the text (change here at......) is a string now its fine ....now i will keep this in mind
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mayanktalwar is offline Offline
16 posts
since Aug 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP/MySQL Coding For a Search Field
Next Thread in PHP Forum Timeline: PHP SEARCH HELP - A Different way ( ?)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC