HDFilmMaker2112 Posted May 16, 2011 Share Posted May 16, 2011 I'm trying to pass a product_id through a URL, to delete the product from the database: <a href="./admincp.php?do=delete&id='.$product_id.'">Delete Product</a> My issue is the code below is not getting the product_id from the URL. elseif($_GET['do']=="delete"){ if(isset($_GET['id'])){ $product_id=$_GET['id']; $sql5000="DELETE FROM $tbl_name WHERE product_id=".$product_id.""; mysql_query($sql5000); $sql5500="DELETE FROM $tbl_name2 WHERE product_id=".$product_id.""; mysql_query($sql5500); header("Location: ./admincp.php?deleted=yes"); } } Link to comment https://forums.phpfreaks.com/topic/236528-issue-passing-product_id-through-url/ Share on other sites More sharing options...
trq Posted May 16, 2011 Share Posted May 16, 2011 Are you sure that is your issue? What does.... echo '<pre>'; print_r($_GET); echo '</pre>'; show? Link to comment https://forums.phpfreaks.com/topic/236528-issue-passing-product_id-through-url/#findComment-1215968 Share on other sites More sharing options...
HDFilmMaker2112 Posted May 16, 2011 Author Share Posted May 16, 2011 Never mind... <a href="./admincp.php?do=delete&id='.$product_id.'">Delete Product</a> should have been: <a href="./product_process.php?do=delete&id='.$product_id.'">Delete Product</a> Basically I was trying to process the product_id with the wrong file. Too early to be coding... Link to comment https://forums.phpfreaks.com/topic/236528-issue-passing-product_id-through-url/#findComment-1215970 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.