Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error after include on last line of code

Status
Not open for further replies.

ssshanest

Programmer
Dec 24, 2004
2
US
Parse error: parse error, unexpected $ in /home/shanest/public_html/wp-content/themes/shanest/index.php on line 24

That's for the following 23 lines of code:

<?php include "header.php"; ?>

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

<div class="headline"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></div>
<div class="subheadline">Posted to <?php the_category(', ') ?> at <?php the_time('g:i A') ?> on <? the_date(); ?></div>
<br />
<div class="story">
<?php the_content('Read the rest of this entry &raquo;'); ?>
</div>
<div class="storyfoot">
<?
$forum = mysql_query("SELECT * FROM wp_categories WHEN ID=the_category_ID();");
$forum_id = mysql_fetch_array($forum);
?>
Discuss in <a href=" $forum_id['forum_id'] ?>"><? the_category_unicode(); ?> Forum</a>
</div>
<?php endwhile; ?>

<?php include "searchform.php"; ?>

<?php include "footer.php"; ?>

What's causing the error?
 
Parse error, unexpected $" is PHP's way of telling you that the parser is expecting more input when it hit the end of the file. Typically, this is caused by unbalanced braces ("{}") or parentheses.

It could also be your ":" in the third line of the script. That character is used for PHP's trinary operator:

$a = (some condition) ? some value : some other value;

It could also be something else. Your programming style of constant context-switching between HTML output and PHP interpretation makes your program flow difficult to follow.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Oops, sorry, I didn't realize you were using the alternate PHP syntax.

Perhaps you're missing an endif? This would be the equivalent of missing a closing curly brace.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top