Jump to content

tpl errors


jkkenzie

Recommended Posts

Am having such codes as below:

<h1> <? =$_SESSION['translator']->out('WELCOME')?>!</h1>

But the output on my page looks like this:

out('WELCOME')?>!

for that line of code.

When i change the <? to <?php an error occurs:

Parse error: syntax error, unexpected '=' ....on line...

 

help

 

Regards,

Jose

 

Link to comment
https://forums.phpfreaks.com/topic/127679-tpl-errors/
Share on other sites

The = echo only works with short tags, try using

 

<?php echo $_SESSION['translator']->out('WELCOME'); ?>

 

Also I think the session is empty, do you have the session_start(); anywhere on the page or any included pages?

 

<?php

session_start();

 

if ( empty($_SESSION['translator']) ){

echo "Session empty.";

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/127679-tpl-errors/#findComment-660759
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.