Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I've the following code:

<?php if ($template['issue']['raw_state'] == 0 && ($helper->user_coordinator($template['issue']['id']) || isset($nparams['tid']))): ?>
    <a href="?id=<?php echo $this->id('cause_form', 'id', $template['issue']['id']) ?>">
        <?php echo $bezlang['add_cause'] ?>
    </a>
<? endif ?>

It works well on most of my servers but on one of them I receive an error:

PHP Parse error: syntax error, unexpected end of file in /var/www/dokuwiki/lib/plugins/bez/tpl/issue_causes.php on line 19,

What is wrong with this code?

The entire file issue_cause.php:

<?php include "issue_box.php" ?>

<div class="bds_block" id="bez_causes">
    <h1><?php echo $bezlang['causes'] ?> <span>(<?php echo count($template['causes']) ?>)</span></h1>
    <div class="bds_block_content">
        <?php foreach ($template['causes'] as $cause): ?>
            <?php include "cause.php" ?>
        <?php endforeach ?>
    </div>
    <?php if ($template['issue']['raw_state'] == 0 && ($helper->user_coordinator($template['issue']['id']) || isset($nparams['tid']))): ?>
        <a href="?id=<?php echo $this->id('cause_form', 'id', $template['issue']['id']) ?>">
            <?php echo $bezlang['add_cause'] ?>
        </a>
    <? endif ?>
</div>

<?php include "removal_confirm.php" ?>
share|improve this question

marked as duplicate by Nana Partykar, Rizier123 php Mar 30 at 15:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
on line 19, but you show only 17 lines here. Are you sure you show us the correct and real file here? – Rizier123 Mar 30 at 15:11
    
you need a semicolon after endofreach and endif like like <?php endforeach; ?> and <?php endif; ?> – Think Different Mar 30 at 15:15
1  
He has not used any where ;. – Nana Partykar Mar 30 at 15:15
    
Make sure short tags are enabled on all servers. – apokryfos Mar 30 at 15:16
    
more of a "why isn't my code working" question – KDOT Mar 30 at 15:17
up vote 1 down vote accepted
Could you replace <? endif ?> with <?php endif ?>
share|improve this answer
    
You're right. How can I overlook that? Old shot_tag_open problem. – ghi Mar 30 at 15:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.