khile Posted October 18, 2010 Share Posted October 18, 2010 im having a few problems with if and endif see line of code below what have i done wrong <? if($forum_user['g_id'] <= USER_MOD):?><th class="tcr"><?php echo $lang_online['IP'] ?></th><?php echo "\n";endif ?> keeps kicking up error: Parse error: syntax error, unexpected T_ENDIF thanks Link to comment https://forums.phpfreaks.com/topic/216164-if-statment/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 18, 2010 Share Posted October 18, 2010 A) The error is probably because you used a short open tag <? B) You should stick to the traditional if(){} construct and you should format your code so that it is readable C) Why are you switching into/out of php so many times in one statement? No one can read that mess, including you. if($forum_user['g_id'] <= USER_MOD){ echo "<th class='tcr'>{$lang_online['IP']}</th>\n"; } Link to comment https://forums.phpfreaks.com/topic/216164-if-statment/#findComment-1123396 Share on other sites More sharing options...
khile Posted October 18, 2010 Author Share Posted October 18, 2010 nm got it working now thanks Link to comment https://forums.phpfreaks.com/topic/216164-if-statment/#findComment-1123400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.