pfkdesign Posted August 28, 2008 Share Posted August 28, 2008 hi i dont know what's wrong with this code, $return .= '<input id="mtm_'. $myItem['itemURL'] .'" name="mtm_'. $myItem['itemURL'] .'" type="checkbox" value="1" '. if ($row_rsmenu['id'] != "") { echo "checked"; }' />'; as soon as i put "if"statement, i will get the "Syntax error, unexpected T_IF" i dont know where is the problem, any idea? ??? Link to comment https://forums.phpfreaks.com/topic/121761-solved-checkbox-problem/ Share on other sites More sharing options...
dezkit Posted August 28, 2008 Share Posted August 28, 2008 Try clearing up the quotes Link to comment https://forums.phpfreaks.com/topic/121761-solved-checkbox-problem/#findComment-628146 Share on other sites More sharing options...
BlueSkyIS Posted August 28, 2008 Share Posted August 28, 2008 you can't append the result of an if statement like you're trying to do. $return .= '<input id="mtm_'. $myItem['itemURL'] .'" name="mtm_'. $myItem['itemURL'] .'" type="checkbox" value="1" '; if ($row_rsmenu['id'] != "") { $return .= "checked"; } $return .= ' />'; Link to comment https://forums.phpfreaks.com/topic/121761-solved-checkbox-problem/#findComment-628149 Share on other sites More sharing options...
pfkdesign Posted August 28, 2008 Author Share Posted August 28, 2008 thank you so much Link to comment https://forums.phpfreaks.com/topic/121761-solved-checkbox-problem/#findComment-628150 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.