1

I am getting the syntax error commented code. Can some have idea, why this error comes

Error: syntax error, unexpected T_STRING, expecting ',' or ';' redmine/app/View/Welcome/index.ctp Line: 4

<h2><?php $this->Candy->html_title(__('Home'))  ?></h2>

<div class="splitcontentleft">
<!-- <%= textilizable Setting.welcome_text %> -->
<?php echo $this->Candy->textilizable($Settings->welcome_text) ?>
<?php if (!empty($news)): ?>
<div class="box">
<h3><?php echo __('Latest news')?></h3>
    <?php echo $this->element('news',array('news' => $news)) ?>
    <?php echo $this->Html->link(__('View all news'), array('controller' =>    
'news')) ?>
</div>
<?php endif; ?>
</div>

Also it works fine in localhost , It seems this is a .htaccess file issue?

Thanks in advance...!!!

3 Answers 3

1

I believe you have missing echo in your title. Use it like this:

<h2><?php echo $this->Candy->html_title(__('Home')); ?></h2>
Sign up to request clarification or add additional context in comments.

4 Comments

Ok can you take a backup of this file and temporarily delete that line and above <h2> line?
@NarendraSinghRajpoot The code inside the HTML comment is not valid PHP code.
sorry actually i am newly on cakePHP if this code is not valid then how it works in localhost?
As I suggested earlier, can you take a backup of this file and temporarily delete that commented line and above <h2> line?
0

you have asp_tags on in php.ini that's why you are getting this error.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' 

you can disable asp_tags in your .htaccess like

php_flag asp_tags off

if you want to disable it for just a single file you can use this

<files file-with-asp-syntax.php>php_flag asp_tags off</files>

you can use this one also ini_set('asp_tags', 0)

Comments

0

If you have asp_tags enabled php script will be processed no matter the fact that is commented in html. Just strip it off <%= and %> and it should work.

If such script would echo anythin it would be commented by html but still processed by PHP.

Comments

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.