Forum Moderators: coopster
How do I get this to work:
<form name='form1' method='post' action='$PHP_SELF'>
<input name='delid' type='hidden' value='$qry[id]'>
<input name'delete' action='submit' type='image' src='/images/delete.png' alt='Delete' width='20' height='20' border='0'>
</form>
I been playing and thougt this should work but it doesn't:
} else if ($delete) {
$array = split(" ",$delid,3);
$delid = CheckAndTrim($array[0]);
echo "$delid <br>"; // this shows the right number
$sql = "DELETE FROM profile_edu WHERE id=$delid";
$result = mysql_query($sql);
echo "$sql - Row deleted!<br>";
}
I been reading and reading about how to do this.
I found something which solves the problem with javascript. Which is not acceptable to me.
[edited by: jatar_k at 5:42 pm (utc) on Feb. 27, 2005]
[edit reason] removed url [/edit]
When using images it maps x and y co-ordinates. There is a thread on this already somewhere, but I can`t find it.
So, try this:
else if(isset($_POST['delete']) ¦¦ isset($_POST['delete_x']))
{
$array = split(" ",$delid,3);
$delid = CheckAndTrim($array[0]);
echo "$delid <br>"; // this shows the right number
$sql = "DELETE FROM profile_edu WHERE id=$delid";
$result = mysql_query($sql);
echo "$sql - Row deleted!<br>";
}
dc
[w3.org...]
Your version gives me blank screen
so I played with it.
Following works without images that after does not work with or without image form.
}
else if (isset($_POST['delete']))
{
$sql = "DELETE FROM profile_bio WHERE id=$delid";
$result = mysql_query($sql);
echo "Row deleted!<p>";
}
======Following does not work==========
}
else if ((isset($_POST['delete'])) ¦¦ (isset($_POST['delete_x'])))
{
$sql = "DELETE FROM profile_bio WHERE id=$delid";
$result = mysql_query($sql);
echo "Row deleted!<p>";
}