delete not functioning!!
Hi all, i'm new to this forum. and i hv problems with php which i cant solved. pls give some advice.
i pass in my values from here:
<?php
print \"<td width=25 align=center><a href=\\"admin.php?action=editUser&id=\".$temp['ID'].\"&rate=\".$temp['rate'].\"&cat=\".$temp['cat'].\"&subcat=\".$temp['subcat'].\"&title=\".$temp['title'].\"&review=\".$temp['review'].\"&name=\".$temp['name'].\"&world=\".$temp['world'].\"&cat_ID=\".$temp['cat_ID'].\"\\"><font face=verdana size=1 color=#ffffff>Edit</font></a></td>\n\";
?>
and then it will call to the function below:
<?php
function editUser()
{
print \"<table border=0 cellspacing=0 cellpadding=0 width=100% align=center>\n\";
print \"<tr height=20><td valign=top><font face=\\"Verdana\\" color=\\"#ffffff\\" size=2><b>Review Administration Panel</b></font></td><td valign=top align=right>\";
print \"</td></tr>\n\";
print \"<form action=\\"$script\\" method=\\"post\\">\n\";
print \"<tr><td colspan=2 valign=middle align=center>\n\";
echo \"$do\";
if ($do == 'Delete')
{
for ($i=0; $i<count($cb) ; $i++)
{
$sql = \"DELETE FROM review WHERE ID = '$ID' AND cat_ID = '$cat_ID' AND status = 'u'\";
$result = mysql_query($sql);
if ($result)
{
print \"<font face=\\"Verdana\\" color=\\"#ffffff\\" size=2>Record Deleted.</font><br>\n\";
}
}
}
else
{
for ($i=0; $i<count($cb) ; $i++)
{
$sql = \"UPDATE review SET flag = '1' WHERE ID = '$ID' AND cat_ID = '$cat_ID' AND status = 'u'\";
$result = mysql_query($sql);
if ($result)
{
print \"<font face=\\"Verdana\\" color=\\"#ffffff\\" size=2>Record Updated.</font><br>\n\";
}
}
}
print \"<table width=500 border=0 cellspacing=1 cellpadding=0 align=center>\n\";
print \"<tr><td align=center><font face=\\"Verdana\\" color=\\"#ffffff\\" size=2><b>Edit User Review</b></font></td></tr>\n\";
print \"<tr><td> </td></tr>\";
print \"<tr><td>\n\";
print \"<table width=100% border=0 cellspacing=0 cellpadding=0>\n\";
print \"<tr bgcolor=#9999ff><td colspan=2> </td></tr>\";
print \"<tr bgcolor=#9999ff><td colspan=2><font face=\\"Verdana\\" color=\\"#ffffff\\" size=2><b>On a scale of 1 to 5, with 5 stars being the best,</b></font>\";
print \"<tr bgcolor=#9999ff><td colspan=2> </td></tr>\";
print \"<tr bgcolor=#9999ff><td width=60
?>
print \"\";
print \"\";
for ($i=1; $i<6; $i++)
{
if ($rate == $i)
print \"$i stars\";
else
print \"$i stars\";
}
print \"\";
print \"2. Please enter a title for your review:\";
print \" \";
print \"\";
print \"3. Type your review in the space below:\";
print \" $review\";
print \"4. Display this information with your review:\";
print \" Your name:\";
print \"\";
print \" Keep me anonymous\";
print \"5. Where in the world are you?\";
print \"(Eg. US)\";
print \" \";
print \"\n\";
print \" \";
print \"\n\";
print \" \";
print \"\";
print \" \n\";
print \"\n\";
print \"\n\";
print \"\n\";
print \"\n\";
print \"\n\";
}
?>
pls help!
Mark Hensler posted this at 16:52 — 19th November 2001.
He has: 4,048 posts
Joined: Aug 2000
Hey joyce, welcome to TWF!
<?php
// ....
print \"<tr align=right><td><input <strong>type=submit value=\\"Update & Approve!\\" name=do</strong> style=\\"background-color: #9999ff; font-family: Verdana; font-weight: bold; color:#ffffff\\">\";
print \" <input <strong>type=submit value=\\"Delete\\" name=do</strong> style=\\"background-color: #9999ff; font-family: Verdana; font-weight: bold; color:#ffffff\\"></td></tr>\n\";
print \"</td></tr></table>\n\";
print \"<input type=hidden name=action value=\\"editUser\\">\n\";
print \"<input <strong>type=hidden name=do value=\\"Update & Approve!\\"</strong>\n\";
print \"<input <strong>type=hidden name=do value=Delete</strong>>\n\";
print \"</form>\n\";
print \"</table>\n\";
}
?>
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.