blackrain87
11-06-2010, 02:26 AM
Hello there,
I have created a page that just has a couple while loops to display some content depending on the url. Here is the page below.
<?php
session_start();
require_once 'database.php';
include("header.php");
echo '<div id="leftnav">';
include("nav.php");
echo '</div><div id="content"><div class="con">';
if (isset($_SESSION['mod'])) {
?>
<a href="?action=userlist">User List</a><br>
<a href="?action=loginattempts">Login Attempts</a><br>
<a href="?action=tickets">Support Tickets</a><br>
<?php
if(isset($_GET['action']) && strcasecmp($_GET['action'], "userlist") == 0) {
?>
<div class="con">
<table>
<tr>
<td>Username</td><td>Location</td><td>Pennies</td><td>Stamleft</td><td>Stamina</td>
<td>Defense</td><td>Strength</td></tr>
$userlist="SELECT username,location,Pennies,stamleft,stamina,defense,strength FROM user";
$userlist2=mysql_query($item,$conn);
while($users=mysql_fetch_array($item2)){
?>
<tr><td><? echo $users['username']; ?></td><td><? echo $users['location']; ?></td><td>
<? echo $users['Pennies']; ?></td><td><? echo $users['stamleft']; ?></td><td>
<? echo $users['stamina']; ?></td><td><? echo $users['defense']; ?></td><td>
<? echo $users['strength']; ?></td></tr>
<?php
} // end of while
?>
</table>
<?php
} // end if of userlist
elseif(isset($_GET['action']) && strcasecmp($_GET['action'], "loginattempts") == 0) {
?>
<div class="con">
<table>
<tr>
<td>IP</td><td>Email Attempt</td><td>Time</td><td>Red</td></tr>
$attempts="SELECT * FROM login_attempts";
$attempts2=mysql_query($item,$conn);
while($logins=mysql_fetch_array($item2)){
?>
<tr><td><? echo $logins['ip']; ?></td><td><? echo $logins['email']; ?></td>
<td><? echo $logins['time']; ?></td><td><? echo $logins['red']; ?></td></tr>
<?php
} // end of while
?>
</table>
<?php
} // end if of loginattempts THIS IS LINE 52!!!!!!
elseif(isset($_GET['action']) && strcasecmp($_GET['action'], "tickets") == 0) {
?>
<div class="con">
<table>
<tr>
<td>Description</td><td>Username</td><td>Time</td><td>Status</td><td>Level</td>
</tr>
<?php
$item="SELECT * FROM tickets";
$item2=mysql_query($item,$conn);
while($items=mysql_fetch_array($item2)){
?>
<tr><td><? echo $items['descrip']; ?></td><td><? echo $items['username']; ?></td><td>
<? echo $items['time']; ?></td><td><? echo $items['status']; ?></td><td>
<? echo $items['level']; ?></td></tr>
<?php
} // end of while
?>
</table>
<?php
}else{
} // end if of tickets
}else{ // if for session set
echo 'You must be a mod to view this page.';
}
?>
But I get this error Parse error: syntax error, unexpected '}' in /home2/newestfu/public_html/*****/******.php on line 52
Line 52 is marked. I cannot figure out why it is there. Usually it's because I forget to close one but I though I had all of them closed, which I have checked.
Any help would be appreciated.
I have created a page that just has a couple while loops to display some content depending on the url. Here is the page below.
<?php
session_start();
require_once 'database.php';
include("header.php");
echo '<div id="leftnav">';
include("nav.php");
echo '</div><div id="content"><div class="con">';
if (isset($_SESSION['mod'])) {
?>
<a href="?action=userlist">User List</a><br>
<a href="?action=loginattempts">Login Attempts</a><br>
<a href="?action=tickets">Support Tickets</a><br>
<?php
if(isset($_GET['action']) && strcasecmp($_GET['action'], "userlist") == 0) {
?>
<div class="con">
<table>
<tr>
<td>Username</td><td>Location</td><td>Pennies</td><td>Stamleft</td><td>Stamina</td>
<td>Defense</td><td>Strength</td></tr>
$userlist="SELECT username,location,Pennies,stamleft,stamina,defense,strength FROM user";
$userlist2=mysql_query($item,$conn);
while($users=mysql_fetch_array($item2)){
?>
<tr><td><? echo $users['username']; ?></td><td><? echo $users['location']; ?></td><td>
<? echo $users['Pennies']; ?></td><td><? echo $users['stamleft']; ?></td><td>
<? echo $users['stamina']; ?></td><td><? echo $users['defense']; ?></td><td>
<? echo $users['strength']; ?></td></tr>
<?php
} // end of while
?>
</table>
<?php
} // end if of userlist
elseif(isset($_GET['action']) && strcasecmp($_GET['action'], "loginattempts") == 0) {
?>
<div class="con">
<table>
<tr>
<td>IP</td><td>Email Attempt</td><td>Time</td><td>Red</td></tr>
$attempts="SELECT * FROM login_attempts";
$attempts2=mysql_query($item,$conn);
while($logins=mysql_fetch_array($item2)){
?>
<tr><td><? echo $logins['ip']; ?></td><td><? echo $logins['email']; ?></td>
<td><? echo $logins['time']; ?></td><td><? echo $logins['red']; ?></td></tr>
<?php
} // end of while
?>
</table>
<?php
} // end if of loginattempts THIS IS LINE 52!!!!!!
elseif(isset($_GET['action']) && strcasecmp($_GET['action'], "tickets") == 0) {
?>
<div class="con">
<table>
<tr>
<td>Description</td><td>Username</td><td>Time</td><td>Status</td><td>Level</td>
</tr>
<?php
$item="SELECT * FROM tickets";
$item2=mysql_query($item,$conn);
while($items=mysql_fetch_array($item2)){
?>
<tr><td><? echo $items['descrip']; ?></td><td><? echo $items['username']; ?></td><td>
<? echo $items['time']; ?></td><td><? echo $items['status']; ?></td><td>
<? echo $items['level']; ?></td></tr>
<?php
} // end of while
?>
</table>
<?php
}else{
} // end if of tickets
}else{ // if for session set
echo 'You must be a mod to view this page.';
}
?>
But I get this error Parse error: syntax error, unexpected '}' in /home2/newestfu/public_html/*****/******.php on line 52
Line 52 is marked. I cannot figure out why it is there. Usually it's because I forget to close one but I though I had all of them closed, which I have checked.
Any help would be appreciated.