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 ^^ Link to comment https://forums.phpfreaks.com/topic/276546-help-please-with-error-syntax-error-unexpected-t_if/ Share on other sites More sharing options...
Barand Posted April 4, 2013 Share Posted April 4, 2013 too many ifs Link to comment https://forums.phpfreaks.com/topic/276546-help-please-with-error-syntax-error-unexpected-t_if/#findComment-1422965 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.... Link to comment https://forums.phpfreaks.com/topic/276546-help-please-with-error-syntax-error-unexpected-t_if/#findComment-1422970 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']) Link to comment https://forums.phpfreaks.com/topic/276546-help-please-with-error-syntax-error-unexpected-t_if/#findComment-1422972 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. Link to comment https://forums.phpfreaks.com/topic/276546-help-please-with-error-syntax-error-unexpected-t_if/#findComment-1422980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.