I have just begun recoding my site and whenever i use PHP to put data on a page via an IF statement it overlaps any cells that are below it, and it also seems to be extending my left menu to the right.

The left menu works when logged in, but when not logged in it extends to the left. And throughout my site the tables overlap when an if statement is used.

My Website (on temp host lol)

And here is an extract of the code that runs the second menu on the left:

<TR><TD background="images/index_07.gif" width="120" height="16" class="titlecontent">
				</TR><TR><TD class="leftcontent">
					if($_SESSION['ID']) {
					echo "Hello ".$_SESSION['Username']."!!<BR>Welcome<p><A HREF=\"?p=logout&r=home\">Logout</A>";
					} else { 
					echo "
					<form name=\"login\" method=\"POST\" action=\"?p=login&a=1&r=".$p."\">
					<input type=\"text\" name=\"User\" id=\"User\" size=\"12\" class=\"menuinput\"><br>
					<input type=\"password\" name=\"Pass\" id=\"Pass\" size=\"12\" class=\"menuinput\"><br>
					<input type=\"Submit\" name=\"Submit\" value=\"Login\">
		echo '</TD></TR><TR><TD>
					<IMG src="images/index_08.gif" width="120" height="16" alt=""></TD></TR>
		</TD>'; ?>
		<TD width="10">
			<IMG src="images/spacer.gif" width="10" height="10" alt=""></TD>



What you describe sure sounds strange, and I wish I could see your site so I'd know what you are talking about, but the link you provided is not working.

You said it works when user is logged in--that the problem occurs when user is NOT logged in. So, let's point the finger at your FORM. Try doing this...this is a stab in the dark....

"<form style=\"margin:0px;padding:0px;\" name=\"login\" method=\"POST\" action=\"?p=login&a=1&r=".$p."\">"


Updated Link - works for me and shows overlapping on main page

I have tried the code you suggested, but it doesnt work :( any more help would be greatly appreciated as that is happening on all pages i make.



any help guys? this really bugging me...i found out its only when i use forms :(

Please build a page that is as simple as possible that displays this issue. Can you create a table with only 2 columns with a form in one that creates this problem? If so, post that code so I can look at it. As it is, I can't tell what you expect the page to look like.

Try it without any PHP -- just HTML. Does the problem still exist?

I usually do trial and error with something like that.
Why don't you view the source code of the sign in page before you log in
and view again after you log in. Compare the codes, you might find a slight difference. That might help, Hope that helps. I am not too good with php... :o