954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to hide a table using php if statement

I want to hide the table when the user is logon.

This is the code;

<div style="padding-left:20px">

<div id="welcome">welcome</div> //* I want to view this when it logon.

<table id="logon" style="height: 165px;" border="0" cellspacing="0" cellpadding="0" width="794">
<tbody>
<tr>

<form name="logon">

<input type="submit" name="Submit" class="button" value="Log In" />

</form>

</tr>
</table>
</div>
waren
Newbie Poster
8 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 
<div style="padding-left:20px">

<div id="welcome">welcome</div> //* I want to view this when it logon.
<?
if($_session[userid]==''){
?>
<table id="logon" style="height: 165px;" border="0" cellspacing="0" cellpadding="0" width="794">
<tbody>
<tr>

<form name="logon">

<input type="submit" name="Submit" class="button" value="Log In" />

</form>

</tr>
</table>
<?
}
?>
</div>
muralikalpana
Posting Pro
540 posts since Sep 2009
Reputation Points: 21
Solved Threads: 36
 

if it helps, you can use Javascript's getElementById() and innerHTML to achieve what you want. PM me if you need help.

steventaal
Newbie Poster
23 posts since Mar 2010
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You