Setting Key Correctly

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 28, 2013   (RSS)

By gregThomas - January 28, 2013 - edited: January 28, 2013

Hi Michael,

I can't see anything that looks obviously wrong. What is the line error you're getting?

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Mohaukla - January 28, 2013 - edited: January 28, 2013

Parse error: syntax error, unexpected T_ELSE in D:\HostingSpaces\rileytours\rileytours.com\wwwroot\about2.php on line 204

This line: I did fix part of it because some of the sequence was on the outside of the dive tag ... so it looks a little different from the one above

<div id="collapse<?php echo $key;?>" <?php if ($key == 0) { echo "class='accordion-body collapse'"; } ?><?php else?>"class=accordion-body collapse in"  <?php endif ?>>
I am thinking it is the echo inside the "If" tag so it is not looking for an "else" tag ....  But without it inside what would the code look like?

Michael

Michael Moyers



Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.



"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"

By gregThomas - January 28, 2013

Hi Michael,

I've found out what the problem is. Here is the corrected line:

<div id="collapse<?php echo $key;?>" <?php if ($key == 0): echo "class='accordion-body collapse'"; else: ?>"class=accordion-body collapse in"  <?php endif ?>> 

The problem was that you had a question mark at the start of the else statement.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com