here is my code on the start page:
<?php require_once('../Connections/test.php'); ?>
<?php
mysql_select_db($database_test, $test);
$query_leag_leagues = "SELECT * FROM leag_leagues ORDER BY
leag_name ASC";
$leag_leagues = mysql_query($query_leag_leagues, $test) or
die(mysql_error());
$row_leag_leagues = mysql_fetch_assoc($leag_leagues);
$totalRows_leag_leagues = mysql_num_rows($leag_leagues);
//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();
session_start();
//this should the the absolute path to the config.php file
//(ie /home/website/yourdomain/login/config.php or
//the location in relationship to the page being protected -
ie ../login/config.php )
require('../config.php');
//this should the the absolute path to the functions.php file
- see the instrcutions for config.php above
require('../functions.php');
//this is group name or username of the group or person that
you wish to allow access to
// - please be advise that the Administrators Groups has
access to all pages.
if (allow_access(admin) != "yes")
{
include ('../no_access.html');
exit;
}
?>
<!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>Slippery Rock Lanes Admin</title>
<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-color: #CCCCCC;
}
a:link {
color: #999999;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #999999;
}
a:hover {
text-decoration: underline;
color: #666666;
}
a:active {
text-decoration: none;
color: #CCCCCC;
}
.style1 {color: #CCCCCC}
-->
</style></head>
<body>
<table width="100%" border="0" bgcolor="#FFFFFF">
<tr>
<td width="16%" rowspan="4" valign="top"><img
src="../assets/admin_pin.png" width="125" height="570"
/></td>
<td width="84%" bgcolor="#FFFFFF"><img
src="../assets/admin_logo.png" width="541" height="56"
/></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> <a
href="adminhome.php">Home</a> - <a
href="adminuser.php">Users</a> - <a
href="adminleague.php">Leagues</a> - <a
href="calendarevents.php">Calendar</a> - <a
href="allys.php">Allys</a> - <a
href="coupons.php">Coupons</a> - <a
href="hours.php">Hours</a> - <a
href="honorroll.php">Honor Roll</a> - <a
href="email.php">Email</a> - <a
href="stats.php">Stats</a> - <a
href="../home.php">View Site </a></td>
</tr>
<tr>
<td height="470" valign="top"
bgcolor="#FFFFFF"><form id="deleterecords"
name="deleterecords" method="post"
action="deleteleagueconfirm.php">
<table width="700" border="1">
<tr>
<td width="24"><div
align="center"></div></td>
<td width="49"><div
align="center">ID</div></td>
<td width="300"><div
align="center">Name</div></td>
<td width="153"><div align="center">Start Date
</div></td>
<td width="152"><div align="center">End Date
</div></td>
</tr>
<?php do { ?>
<tr>
<td><div align="center">
<input name="id" type="checkbox" id="id[]"
value="<?php echo $row_leag_leagues['leag_id']; ?>" />
</div></td>
<td><?php echo $row_leag_leagues['leag_id'];
?></td>
<td><?php echo $row_leag_leagues['leag_name'];
?></td>
<td><?php echo $row_leag_leagues['leag_startdate'];
?></td>
<td><?php echo $row_leag_leagues['leag_enddate'];
?></td>
</tr>
<?php } while ($row_leag_leagues =
mysql_fetch_assoc($leag_leagues)); ?>
<tr>
<td colspan="5"><div align="right">
<input type="submit" name="Submit" value="Delete Records"
/>
</div></td>
</tr>
</table>
</form> <p></p></td>
</tr>
<tr>
<td valign="top" bgcolor="#FFFFFF"><div
align="right" class="style1">This Web Site Is Powered By Myth
Tech Administration Technologies </div></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($leag_leagues);
?>
And here is my code for the delete page:
<?php require("../config.php") ?>
<?php
$con = mysql_connect("localhost",$username,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db_name, $con);
if(isset($_POST["id"])) {
$delete = implode(",",$_POST["id"]);
$query = sprintf("DELETE FROM leag_leagues WHERE leag_id IN
(%s)",$delete);
mysql_query($query);
?>