fife Posted June 7, 2011 Share Posted June 7, 2011 I have this php code for echoing an address of my member. Certain arts of the address are not always there <?php if($TheClub['addressL1']!==NULL) { echo "<li>{$TheClub['addressL1']}</li>"; } if($TheClub['addressL2']!==NULL) { echo "<li>{$TheClub['addressL2']}</li>"; } if($TheClub['addressL3']!==NULL) { echo "<li>{$TheClub['addressL3']}</li>"; } echo "<li>{$TheClub['area']}</li>"; echo "<li>{$TheClub['county']}<?li>"; echo "<li>{$TheClub['country']}</li>"; echo "<li>{$TheClub['postcode']}</li>"; ?> the code works fine in crome and all other browsers it looks like so addressL1 addressL2 addressL3 area county country postcode In IE however lets say addressL2 and area was missing it shows with nasty line spaces like so addressL1 addressL3 county country postcode Is there a way of stopping this? Ive tried using an else { } but that has not solved the issue. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/238706-nasty-ie-7-issues/ Share on other sites More sharing options...
kenrbnsn Posted June 7, 2011 Share Posted June 7, 2011 Please post the code that's used to obtain the array values. Ken Quote Link to comment https://forums.phpfreaks.com/topic/238706-nasty-ie-7-issues/#findComment-1226634 Share on other sites More sharing options...
fife Posted June 7, 2011 Author Share Posted June 7, 2011 $TheClubq = mysql_query("SELECT * FROM table WHERE clubID = '$_SESSION['ClubID']'"); $TheClub = mysql_fetch_array($TheClubq); Quote Link to comment https://forums.phpfreaks.com/topic/238706-nasty-ie-7-issues/#findComment-1226636 Share on other sites More sharing options...
kenrbnsn Posted June 7, 2011 Share Posted June 7, 2011 Instead of using "!== NULL", try using "!= ''" in your code: <?php if($TheClub['addressL1'] != '') { echo "<li>{$TheClub['addressL1']}</li>"; } if($TheClub['addressL2'] != '') { echo "<li>{$TheClub['addressL2']}</li>"; } if($TheClub['addressL3'] != '') { echo "<li>{$TheClub['addressL3']}</li>"; } echo "<li>{$TheClub['area']}</li>"; echo "<li>{$TheClub['county']}<li>"; echo "<li>{$TheClub['country']}</li>"; echo "<li>{$TheClub['postcode']}</li>"; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/238706-nasty-ie-7-issues/#findComment-1226640 Share on other sites More sharing options...
fife Posted June 7, 2011 Author Share Posted June 7, 2011 Cheers Ken. That fixed everything Quote Link to comment https://forums.phpfreaks.com/topic/238706-nasty-ie-7-issues/#findComment-1226644 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.