hi,
im kinda new at php and just put together a script that allows a user to upload articles and insert the article's headline into a table. I also setup the option for the user to delete all previous articles from the month before, but i want some sort of confirmation screen before all rows are deleted. I have tried with forms and proved to be annoying, so now i have tried with the following script segment(that doesnt work):
if($delete)
//posted from form
function the_script()
{
global $action;
if ($action == 'delete')
{
db_connect();
$sql = "DELETE from test WHERE id=$id";
$result = mysql_query($sql);
echo "<br><br>All Previous Headlines Deleted Successfully<br>";
exit;
}
}
{
the_script();
echo "<br><br>Delete this? <a href=\"$PHP_SELF?action=delete\">Yes</a> or <a href=\"Javascript:history.go(-1);\">No</a>";
}
not sure if im on the right track with this.
can anyone help?
thanks,
MIKE