thanx
Here is the code
**form page**
Code: Select all
<form action="delete.php" method="post">
<input type="submit" name="submit" value="Select First 10 Names">
</form>Code: Select all
<?php
include "functions.php";
$page_title = "Delete/Update";
include "startpage.php";
if ($submit =="Select First 10 Names")
{
$query = select_entry($first_name,$middle_name,$last_name,$email,$photo);
}
function select_entry($first_name,$middle_name,$last_name,$email,$photo)
{
?>
<form method="post">
<hr size=3>
<?php
$query = mysql_query("select * from Names order by Last_Name limit 10");
while($row = mysql_fetch_array($query))
{
$first_name= $rowї"First_Name"];
$middle_name = $rowї"Middle_Name"];
$last_name = $rowї"Last_Name"];
$email = $rowї"Email"];
$photo=$rowї"Photo"];
?>
<table width="100%" border="0" >
<tr>
<td align=right width=50%>
<?php
echo "First Name: <input type=text name="first_name" size="30" maxlength="40"value="$first_name" ><br>\n";
echo "Middle Name: <input type=text name="middle_name" size="30" maxlength="40" value="$middle_name"><br>\n";
echo "Last Name: <input type=text name="last_name" size="30" maxlength="40" value="$last_name"><br><br>\n";
echo "Email: <input type=text name="email" size="30" maxlength="40" value="$email" "readonly"><br><br>\n";
echo "Photo: <input type=text name="photo" size="30" maxlength="70" value="$photo"><br><br>\n";
echo "<input type="checkbox" name="emailї]" value="$email"><b>Delete?</b>\n";
?>
</td>
<td align=right width=50%>
<?php
echo "$photo";
?>
</td>
</tr>
</table>
<hr size=3><br>
<?php
}
?>
<input type=submit name=submit value="Delete Enteries">
<input type=reset>
</form>
<?php
}
elseif ($submit=="Delete Enteries")
{
if (is_array($email))
{
while (list($key,$value) = each($email))
{
$query= mysql_query ("delete from Names where Email='$value'");
//echo "$valueї$key]";
}
}
}
include "endpage.php";
?>