you are using clientside javascript to call a serverside function - no can do...this echo "<a href='#' onClick='doDelete('";
will not work...
there are a couple of different ways to handle this
1. use clientside javascript to pass the id of the 'to delete' item to another page(via some kind of popup window), place the data in a form and autosubmit that form (could ask for confirmation here)
to a serverside script that deletes the data.
pros - looks good, asks for confirmation, never leave the page so multiple deletes can be done
cons - more complex to program
- change the link to call the serverside script directly
echo "<a href='www.mysite.com/delete.php?id=$login'>Delete</a>";
pros - simpler to do, just a small mod of what you do now, cleaner to code, easy to do
cons - doesn;t ask for confirmation
it's up to you how you would like to approach it.
let me know if you need more details.
hth