Hi Every Body
I have a samll piece of code written in php my problem is code is not deleting record from my database. Please see the code below which is calling deleteadministratorexe.php - which is actually deleting the record. Files are attached here -
<?php
require_once('security.php');
require_once('connection.php');
?>
<!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>Member Index</title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5
{
font-size: 9px;
color: #FF9900;
font-weight: bold;
}
-->
</style>
<script type="text/javascript" >function fo(){viby.dtext.focus();}</script>
</head>
<body onload="fo();">
<h1>Welcome <font color="#FF6600"><?php echo $_SESSION['loginname']; ?></font></h1>| <a href="logout.php">Logout</a>
<p>This is a password protected area only accessible to members. </p>
<div align="center">
<form name="viby" method="post" action="">
<table width="366" border="1">
<tr>
<td><h2 class="style5">ENTER CUSTODIAN ID</h2></td>
<td><input name="dtext" type="text" /></td>
<td><input type="submit" name="Submit" value="VIEW" /></td>
</tr>
</table>
</form>
</div>
<form method="post" action="deleteadministratorexe.php">
<table width=100% border=1>
<tr>
<td width=42 height=28 bgcolor=#FFFF99>ID</td>
<td width=61 bgcolor=#FFFF99>CODE</td>
<td width=77 bgcolor=#FFFF99>Password</td>
<td width=92 bgcolor=#FFFF99>Departmenet ID </td>
<td width=77 bgcolor=#FFFF99>E-Mail</td>
<td width=108 bgcolor=#FFFF99>Security Level </td>
<td width=81 bgcolor=#FFFF99>Last Login </td>
<td width=92 bgcolor=#FFFF99>Account ID </td>
<td width=75 bgcolor=#FFFF99>Customer Name </td>
<td width=77 bgcolor=#FFFF99>Customer Rank </td>
<td width=123 bgcolor=#FFFF99>Customer PH </td>
</tr>
<?php
if (isset($_POST['dtext']))
{
$qry = "SELECT * FROM users_table where cust_id = $_POST[dtext]" or die("Display Error: ".mysql_error());
$result = mysql_query($qry);
while($row=mysql_fetch_array($result))
{
echo " <tr>
<td><input name=t1 type=text id=t14 value=$row[0] ></td>
<td><input name=t2 type=text id=t2 value=$row[1] ></td>
<td><input name=t3 type=text id=t3 value=$row[2] ></td>
<td><input name=t4 type=text id=t4 value=$row[3] ></td>
<td><input name=t5 type=text id=t5 value=$row[4] ></td>
<td><input name=t6 type=text id=t6 value=$row[5] ></td>
<td><input name=t7 type=text id=t7 value=$row[6] ></td>
<td><input name=t8 type=text id=t8 value=$row[7] ></td>
<td><input name=t9 type=text id=t9 value=$row[8] ></td>
<td><input name=t10 type=text id=t10 value=$row[9]></td>
<td><input name=t11 type=text id=t11 value=$row[10]></td>
</tr>";
}
}
?>
<tr>
<td height="23" colspan="6"><input align="right" name="RESET" type="reset" id="RESET" value="Reset" /></td>
<td colspan="5"><input align="left" name="DELETE" type="submit" id="DELETE" value="Delete" /> </td>
</tr>
</table>
</form>
||<a href="member.php"> GO TO INDEX</a>
</body>
</html>