Jump to content

nasty ie 7 issues


fife

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/238706-nasty-ie-7-issues/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/238706-nasty-ie-7-issues/#findComment-1226640
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.