Jump to content

help please with error: syntax error, unexpected T_IF


paint

Recommended Posts

Hello everyone!

I'm adding new fields to the feedback.tpl in DLE. The file is in engine/ajax/feedback.tpl

Here is the code:

 

    $row['template'] = stripslashes( $row['template'] );
    $row['template'] = str_replace( "{%username_to%}", $recipient['fullname'], $row['template'] );
    $row['template'] = str_replace( "{%username_from%}", $name, $row['template'] );
    $row['template'] = str_replace( "{%text%}", $message, $row['template'] );
    $row['template'] = str_replace( "{%ip%}", $_SERVER['REMOTE_ADDR'], $row['template'] );
    if(if(empty($_POST[team])) $_POST[team] = "none";
    $row['template'] = str_replace( "{%team%}", strip_tags($_POST[team]), $row['template'] );

 

I'm adding the field, called 'team' and get this error: syntax error, unexpected T_IF

 

But when I remove the first if and bracket, everything works fine, but I always get 'none' result, like the field is empty, but it's not...

 

Help please ^^

I told, that when I remove the first if like that:

if(empty($_POST[team])) $_POST[team] = "none";
$row['template'] = str_replace( "{%team%}", strip_tags($_POST[team]), $row['template'] );

 

everything is working fine except that thing, that I get 'none' result, even if the field is not empty....

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.