Page 1 of 1

Show or Hide Image on Yes or Not?

Posted: Tue Jul 06, 2010 1:35 pm
by gertrudis
Hi all, I need show an image depending on yes or not, but the problem after it show on doesn't go way and both keep in the screen.

i need to hide one of then.

this is my code:
if($_SESSION['userstate']='yes')
{
/echo "<img src='images/login.gif'>";
}
if($_SESSION['cback']='no')
{
// echo "<img src='images/logoff.gif'>";
}

thanks in advance.

Re: Show or Hide Image on Yes or Not?

Posted: Tue Jul 06, 2010 1:53 pm
by Jade
It sounds like you want to toggle the display of the image without refreshing the page. That would require javascript or ajax. The only way to clear the image off of the page using PHP would be to update the session variable then do a refresh.