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 ^^

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.