bluedot Posted January 2, 2007 Share Posted January 2, 2007 Hi I have the following code:At the begining I have an IF statment checking to see if the status = "loggedin" Using an echo statement I know that the correct status is getting that far. As well as "background-color: #FFFFCC;" is executed as the background of the page is the correct color. but after that nothing is displayed, the page comes up blank (except for the background color). I have other pages that do almost the exact same thing, am i missing somthing? Thank you very much.[code]<?phpsession_start();if($_SESSION["status"]==="loggedin"){?><html><head><title>CSA Leaders Admin Page</title><style type="text/css"><!--body { background-color: #FFFFCC;}--></style></head></head><body><?php include ("DBlogin.php"); include ("connectDB.php"); $result = mysql_query("SELECT * FROM userinfo WHERE username='$user'", $hd) or die("Error querying database"); while($row = @mysql_fetch_assoc($result)) {?><table width="760" height="355" border="1"> <tr> <td width="144" rowspan="4"><img src="414f6e1a.gif" width="130" height="205" alt="logo" /></td> <td width="429" rowspan="4"><div align="center"> <h2><strong>Welcome to the CSA Leaders Admin Page </strong></h2> </div></td> <td height="36"><div align="center"><a href="changeuserform.php">Change Username </a></div></td> </tr> <tr> <td height="36"><div align="center"><a href="changepassform.php">Change Password</a></div></td> </tr> <tr> <td height="36"><div align="center"><a href="edituservalid.php">Change Personal Info</a></div></td> </tr> <tr> <td width="165" height="68"> </td> </tr> <tr> <td height="23" colspan="3"><p><? if ("$row[fname]" != ""){ echo "Welcome $row[fname]"; } else { echo "Please Update your personal information"; }?></p> <p><strong>What would you like to do? </strong></p></td> </tr> <tr> <td height="27"><div align="center"><a href="eventmenu.php">Edit Events </a></div></td> <td colspan="2" rowspan="4">Please email Josh W. for help/tips etc.</td> </tr> <tr> <td height="23"> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr></table><?}} else { echo "This is an Admin page only!<META HTTP-EQUIV = 'Refresh' Content = '2; URL =login.php'>"; }?></body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/32590-html-in-an-if-not-displaying/ Share on other sites More sharing options...
boo_lolly Posted January 2, 2007 Share Posted January 2, 2007 you closed your <head> tag twice. maybe that's the issue. Quote Link to comment https://forums.phpfreaks.com/topic/32590-html-in-an-if-not-displaying/#findComment-151622 Share on other sites More sharing options...
ober Posted January 2, 2007 Share Posted January 2, 2007 First off, you're using 3 equals signs... you only need 2.Secondly, you're using short tags later in the page. Some servers don't support short tags.Third, check your other part to see if it's actually doing the query. Quote Link to comment https://forums.phpfreaks.com/topic/32590-html-in-an-if-not-displaying/#findComment-151625 Share on other sites More sharing options...
AndyB Posted January 3, 2007 Share Posted January 3, 2007 === is OKWhere does the value of $user come from? My guess is it doesn't exist, the query works and returns no results, hence the blank page. Remove the @ symbol as well - it's only going to cause trouble. Quote Link to comment https://forums.phpfreaks.com/topic/32590-html-in-an-if-not-displaying/#findComment-151849 Share on other sites More sharing options...
bluedot Posted January 3, 2007 Author Share Posted January 3, 2007 It was the $user thing, thank you very much :) Quote Link to comment https://forums.phpfreaks.com/topic/32590-html-in-an-if-not-displaying/#findComment-152317 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.