Praetorian Posted April 2, 2009 Share Posted April 2, 2009 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 More sharing options...
Praetorian Posted April 2, 2009 Author Share Posted April 2, 2009 Nevermind. I'm just stupid. Forgot to turn the type=submit to a type=button. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.