Jump to content

HTML in an IF not displaying


bluedot

Recommended Posts

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]<?php
session_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">&nbsp;</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">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<?
}
} else {
    echo "This is an Admin page only!<META HTTP-EQUIV = 'Refresh' Content = '2; URL =login.php'>";
    }
?>
</body>
</html>
[/code]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.