Show or Hide Image on Yes or Not?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gertrudis
Forum Newbie
Posts: 14
Joined: Wed Jan 27, 2010 8:15 pm

Show or Hide Image on Yes or Not?

Post 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.
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Show or Hide Image on Yes or Not?

Post 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.
Post Reply