hi all
i was trying to delete a record from a data base based on the value of hidden filed i made.but this is not performed in a proper way....so how can i do this
here is what i get!!!
<?
$query = "SELECT title, url FROM managelinks";
$queryResult = mysql_query($query);
"<div align=\"center\"><form name=\"makechange\" id=\"f1\" method=\"get\" action=\"" ";
'<table id="t" border=3>';
while ($links = mysql_fetch_array($queryResult))
{
echo'<tr><td><input type="textbox" name="ti" value="'.$links->title.'" readonly="readonly"></td>';
echo'<td><input type="textbox" name="ur" value="'.$links->url.'" readonly="readonly"></td>';
echo'<td><input type="submit" name="Edit" value="Edit"></td>';
echo'<td><input type="submit" name="delete" value="Delete"> <INPUT TYPE="hidden" name="delete" VALUE="'.$links->title.'"></td>';
echo'</br>';
echo '</tr>';
}
echo'</table></form></div>';
if ($_GET[delete])
{
$query3 = "delete from managelinks where title='+document.f1.item("delete").value+'";//here the problem
$queryResult3 = mysql_query($query3);
if($queryResult3)
{
echo"Deleted ok";
}
}
?>
i was trying to delete a record from a data base based on the value of hidden filed i made.but this is not performed in a proper way....so how can i do this
here is what i get!!!
<?
$query = "SELECT title, url FROM managelinks";
$queryResult = mysql_query($query);
"<div align=\"center\"><form name=\"makechange\" id=\"f1\" method=\"get\" action=\"" ";
'<table id="t" border=3>';
while ($links = mysql_fetch_array($queryResult))
{
echo'<tr><td><input type="textbox" name="ti" value="'.$links->title.'" readonly="readonly"></td>';
echo'<td><input type="textbox" name="ur" value="'.$links->url.'" readonly="readonly"></td>';
echo'<td><input type="submit" name="Edit" value="Edit"></td>';
echo'<td><input type="submit" name="delete" value="Delete"> <INPUT TYPE="hidden" name="delete" VALUE="'.$links->title.'"></td>';
echo'</br>';
echo '</tr>';
}
echo'</table></form></div>';
if ($_GET[delete])
{
$query3 = "delete from managelinks where title='+document.f1.item("delete").value+'";//here the problem
$queryResult3 = mysql_query($query3);
if($queryResult3)
{
echo"Deleted ok";
}
}
?>