paint Posted April 4, 2013 Share Posted April 4, 2013 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 ^^ Quote Link to comment Share on other sites More sharing options...
Barand Posted April 4, 2013 Share Posted April 4, 2013 too many ifs Quote Link to comment Share on other sites More sharing options...
paint Posted April 4, 2013 Author Share Posted April 4, 2013 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.... Quote Link to comment Share on other sites More sharing options...
Barand Posted April 4, 2013 Share Posted April 4, 2013 try echo '<pre>'.print_r($_POST, 1).'</pre>'; to check the contents of the POST array. (BTW, string indexes for an array should be quoted eg $_POST['team']) Quote Link to comment Share on other sites More sharing options...
paint Posted April 4, 2013 Author Share Posted April 4, 2013 I think I need to put ) somwhere, but I don't know where exactly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.