Jump to content

Multiple $_get Fields


Praetorian
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...