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
https://forums.phpfreaks.com/topic/32590-html-in-an-if-not-displaying/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.