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:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 2:30 AM
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to