I seriously doubt it.
I've used some source code i found to create a user admin section. It is working but I think that the way I have it coded to display the page whether the user is logged on or not is not efficient.
I've got the code duplicated whether they are loogged in or not.
I also want to create parts on the page where I pull data from a database but I'm having trouble figuring out how to do that.
Here is the script: (Any italic text is where I'm having trouble. Any help would be greatly appreciated).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ultimate Poolies - Compete against the world's ULTIMATE SPORTS POOLIES</title>
</head>
<body background="images/bg.gif">
<?php
include ("config.php");
Include the config.php file here
error_reporting (E_ALL & ~ E_NOTICE);
Don't show notices.
if (!empty($online['id'])){
Check to see if they're logged in
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="850">
<tr>
<td bgcolor="#FFFFFF"><font face="SerpentineDBol" size="+3" color="#FF0000">Ultimate Poolies.com </font>
Welcome <b>'.stripslashes($online['username']).'</b>- <a href="logout.php">Logout</a><br /></td>
</tr>
<tr>
<td height="22" background="images/nav_bar_02.jpg"><font color="#FFFFFF"><marquee behavior="slide" height="22" direction="left">Welcome to ULTIMATE POOLIES.com We are pleased to announce that our HOCKEY Contests are now in progress!!!</marquee></font></td>
</tr>
<tr><td>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td width="262" bgcolor="#EEEEEE" align="center" valign="top">
<table bgcolor="#FFFFCC">
<tr>
<td><br />Contest Leaders to go here!</td> # I would like to add code here that displays data from my database... I can't figure out how to get the query here in a way that I'm not nesting <? and ?> tags </tr>
</table>
</td>
<td width="530" bgcolor="#FFFFFF"><br />
<table>
<tr>
<td valign="top"><h3>
Welcome to Ultimate Poolies.com</h3> Home to the fastest growing fantasy sports contest site on the web.<br />
<ul>
<li>Pay $1, $2 or $5 to play our Fantasy Sports Contests</li>
<li>Test your Skill to Win the Progressive Prizes.</li>
<li>Guaranteed Winners Every Day!!</li>
<br />or<br />
<li>Play for bragging rights. All the same contests but free. </li>
</ul>
</td>
</tr>
<tr>
<td><h3>Fantasy Sports Contests!</h3></td>
</tr>
<tr>
<td><a href="hockey_contests.php">Hockey Contests</a></td>
</tr>
</table>
</td>
<td width="232" bgcolor="#EEEEEE" align="center"><iframe src="http://www.sportznetwork.com/ticker/ticker.php" name="ticker" scrolling="no" frameborder="no" height = "275px" width = "180px">
</iframe></td>
</tr>
</table>
</td>
</tr>
</table>';
}
else {
Else, they are not logged in.
echo '<table align="center" border="0" cellpadding="0" cellspacing="0" width="850">
<tr>
<td bgcolor="#FFFFFF"><font face="SerpentineDBol" size="+3" color="#FF0000">Ultimate Poolies.com </font>
<a href="login.php">Login | </a><a href="register.php">Register</a><br /></td>
</tr>
<tr>
<td height="22" background="images/nav_bar_02.jpg"><font color="#FFFFFF"><marquee behavior="slide" height="22" direction="left">Welcome to ULTIMATE POOLIES.com We are pleased to announce that our HOCKEY Contests are now in progress!!!</marquee></font></td>
</tr>
<tr><td>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td width="262" bgcolor="#EEEEEE" align="center" valign="top">
<table bgcolor="#FFFFCC">
<tr>
<td><br />Contest Leaders to go here!</td>
</tr>
</table>
</td>
<td width="530" bgcolor="#FFFFFF"><br />
<table>
<tr>
<td valign="top"><h3>
Welcome to Ultimate Poolies.com</h3> Home to the fastest growing fantasy sports contest site on the web.<br />
<ul>
<li>Pay $1, $2 or $5 to play our Fantasy Sports Contests</li>
<li>Test your Skill to Win the Progressive Prizes.</li>
<li>Guaranteed Winners Every Day!!</li>
<br />or<br />
<li>Play for bragging rights. All the same contests but free. </li>
</ul>
</td>
</tr>
<tr>
<td><h3>Fantasy Sports Contests!</h3></td>
</tr>
<tr>
<td><a href="hockey_contests.php">Hockey Contests</a></td>
</tr>
</table>
</td>
<td width="232" bgcolor="#EEEEEE" align="center"><iframe src="http://www.sportznetwork.com/ticker/ticker.php" name="ticker" scrolling="no" frameborder="no" height = "275px" width = "180px">
</iframe></td>
</tr>
</table>
</td>
</tr>
</table>';
/
Note, you could include the login.php file here
/
}
?>
</body>
</html>[/B]