[solved] Script doesn't GET id variable
Posted: Fri Aug 22, 2008 12:14 pm
I use the $newsid variable to get the ID of a news article from the database. It worked, I could delete an article by clicking a link, but I decided to add a confirm box to confirm that the user really wanted to delete it. Problem is that when I click OK on the confirm box the following location is parsed "http://localhost/testing/show.php?action=delete&id=", which as you see the id variable appears to be blank now. Is something wrong the way I do this? Something with the script?
Code: Select all
<script language=\"javascript\">
function confirm_delete()
{
var deleteok = confirm(\"Do you really want to delete this article?\")
if (deleteok)
{
//delete entry
window.location = \"show.php?action=delete&id=$newsid\";
}
else
{
alert(\"Cancelled!\");
}
}
</script>