Hi All,

Could you help/guide me accordingly please...My intentions with this piece of code is for the relevant image to display with the respective user...my problem is that it doesn't work for the second user type (SysAdmin), it only works for 'Admin'...

<tr>
				
				
				
					<td width="255">
					<?
						if($arr[6] != 'Admin' || $arr[6] != 'SysAdmin') 
						{
					?>
						<div align="center"><img src="images/bill.png" alt="Bill" /></div>
					<?						
						}
						else						
						{
					?>
						<div align="center"><a href="underConstruction.php"><img src="images/bill.png" alt="Bill" /></a></div>					
					<?	
						}
					?>
					</td>
</tr>

May

Recommended Answers

All 2 Replies

i made an adjustment and cleaned up the code to make it easier to read.

see if it works.

<?php

echo '<tr>';
echo '<td width="255">';

if ($arr[6] !== 'Admin' && $arr[6] !== 'SysAdmin') {
	echo '<div align="center"><img src="images/bill.png" alt="Bill" /></div>';
}
else {
	echo '<div align="center"><a href="underConstruction.php"><img src="images/bill.png" alt="Bill" /></a></div>';
}

echo '</td>';
echo '</tr>';

?>

Hi kkeith29,

Thanks so much, it works now...I did try using the &&, but not !==, and since that didn't work, I posted it here...thanks again...:)

May

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.