Jump to content

Multiple $_get Fields


Praetorian

Recommended Posts

I'm trying to pass more than one $_GET to a page using a javascript redirect, but it's not working. Here's the javascript..

<script language="javascript">	function deleteMe(href,name)	{		var answer = confirm("Are you sure you wish to delete \"" + name + "\"?");		if(answer == true)		{			location.href = href;		}	}</script>

This is the link I'm trying to send to the next page..

<input type="submit" onclick="deleteMe('manage_pages.php?delete=<?= $id ?>&delete_page=<?= $name ?>','<?= $name ?>');" value="Delete Page" />

And the php on the next page to catch it..

if(!empty($_GET['delete']) AND !empty($_GET['delete_page'])){	$delete_page = pdo_query($cxn,"DELETE FROM pages WHERE id = ?",array($_GET['delete']));	unlink('../'.$_GET['delete_page'].'.php');	header("Location: manage_pages.php?edit_pages");}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...