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? ??? Quote 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 Quote 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 .= ' />'; Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/121761-solved-checkbox-problem/#findComment-628150 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.