0

I'm having a strange issue here, i have this bit of code:

<?php
if ($node->nid == "1") {
    include 'front.tpl.php';
    return;
} else { 
?>

    <div id="left-col" class="grid_9">
        <h1><?php print $title ?></h1>
        <hr />
        <?php global $user;if ( $is_admin ) { ?>[<a href="/node/<?php print $node->nid ?>/edit">Edit</a>]<? } ?>
            <?php if ($show_messages) { print $messages; } ?>
                <?php print $help ?>
            <?php print $content; ?>        
    </div>
<?php } ?>

This exact code is working fine on the staging server, i've litrally just installed a LAMP stack using XAMPP and downloaded the code from the server.

PHP is now throwing this error:

Parse error: syntax error, unexpected $end in F:\Workspace\xx\xx\xx\xx\xx\node.tpl.php on line 19

Anyone have any ideas what it could be? i have a feeling it "might" be due to the jumping in and out of tags but i'm not certain, can anyone shed some light on this. (this might be a server issue in which case i will also happily take advice on what php.ini settings need to be poked in the right direction!

Thanks in advance.

2
  • Are both machines running the same version of PHP with the same settings in PHP.ini? Commented Dec 10, 2009 at 2:45
  • Are you using some kind of templating engine ? (your file's name "node.tpl.php" might suggest this) Commented Dec 10, 2009 at 2:49

1 Answer 1

3

My guess is the server doesn't have short tag support turned on.

<? } ?>
Sign up to request clarification or add additional context in comments.

3 Comments

perfect, that was it, didn't see that cheeky short tag there on the side. Thanks :)
+1 good eyesight! Might help to keep the <?php ... { ?>...<?php } ?> structures on a consistently-indented line of their own, to make this easier to spot?
any idea how to make server to support short tag? is it possible somehow?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.