RE: [PHP] Silly table and php question.

From: Date: Thu, 12 Jul 2001 08:00:33 +0000
Subject: RE: [PHP] Silly table and php question.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57557@lists.php.net to get a copy of this message
Well, I guess what you can do is embed the PHP within the table cell and call an if statement. Like this... <table> <tr> <td> // if the user is online, then display the "online" image <?php If ($user = "online") { ?> <img src="online.gif"> // else if the user is offline, display the "offline" image <?php } elseif ($user = "offline") { ?> <img src="offline.gif"> // This is just some error checking <?php } else { echo "$some_error"; ?> <?php } ?> </td> </tr> </table> Try that, it's simple and short, and it works within the table cell you would specify. Of course, you may have to alter the code and the code structure a bit to fit your scheme. If you're new to PHP then stripping away the comments I placed for you might help to make the code look more clear to you. Good luck... Navid Yar -----Original Message----- From: Johan Vikerskog (ECS) [mailto:Johan.Vikerskog@ecs.ericsson.se] Sent: Thursday, July 12, 2001 2:30 AM To: php-general@lists.php.net Subject: [PHP] Silly table and php question. Hi all. I know this is a silly question but i dont know how to do it so thats why i am asking. Be gentle towards me. Im just a stupid swede! ;-) statement: I have a table cell in my upper right corner. I have a small php script which checks wheter my user is online or not. If the user is i want to update that cell with an gif that i made that says online. How do i update just that cell? Is there a special function in PHP to do that? I know the question is silly but bare with me. //Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#57557) next »