English 中文(简体)
PHP broken code on local machine but working on staging server
原标题:

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:Workspacexxxxxxxxxx
ode.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.

最佳回答

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

<? } ?>
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签