What you are trying to do can be acheived via the $_GET method.
Since PHP is a server-side language, this isn't really possible to do this with JavaScript. Well JavaScript can trigger an event-handler to open a window and send the HTTP request and then close the window. But that's not usually a very practical way of doing things.
Here is an example of how you would complete your record deletion using PHP and the $_GET method.
Code:
<?php
if (isset($_GET["delete"] && $_GET["delete"] == true) {
# If $_GET["delete"] exists and contains a true value
# execute query statement here
}
echo "<a href=\"{$_SERVER["PHP_SELF"]}?delete=1\">Click here to delete the record</a>";
?>
The $_GET method essentially takes the values declared after the question mark and reads those into the variable namespace in name value pairs under the $_GET[""] super-global array.
$_SERVER["PHP_SELF"] will contain the name of the current script running and will cause the same page to reload.
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::