Hello guys,
Firstly i would like to say hello to everyone! 🙂
I run a chat site with members profiles that allows members to email each other by clicking a link on a members profile page.
I have already written a script that displays an image link (when a user is logged in) to appear on a members profile page to allow members to contact each other.
However, it only shows up when the member is logged in, how do i get a different image or text link to show if the guest/member is not logged in?
eg.
When the member has logged in an image link says 'send message' but when a member is not logged in it shows a text link saying 'login to send message'
My guess is this needs to be an 'if something = ' ' then echo this instead' statement?
Heres the code that displays an image when a member has logged in but how to i get it to display a different image when there not logged in? (at the moment it displays an empty space where the image should be).
<?
$tmp=mysql_query("SELECT * FROM ".C_MYSQL_MEMBERS." WHERE id='".$_SESSION['m']."'");
while($i=mysql_fetch_array($tmp)){
$name = ($i['email']);
$password = ($i['password']);
echo "<input type=hidden name=username value=".$name."><input type=hidden name=password value=".$password."><input type=image src=members/sendamessage.gif alt='send a message'>";}
?>
Might be easier to see what i am talking about by visiting my website! 🙂 lol
http://www.swindonchat.co.uk/members
Any help would be appreciated.
Thank you!