Joshua F Posted February 7, 2010 Share Posted February 7, 2010 I am trying to make a Application Deleter. I copied the code from my Link Deleter(For something on my site), and I keep getting the error "You left 1 or more boxes empty!". I click Delete on the page, and It just gives that error. The link deleter works though. Help me :S. Heres my Code: <?php if(isset($_SESSION['admin'])){ if($_SERVER['REQUEST_METHOD'] == 'POST') { if($_POST['ign'] == "") { echo "You have left 1 or more boxes empty!"; } else { mysql_query("DELETE FROM apps WHERE ign=\"" . realEscape($_POST["ign"]) . "\""); echo "You have successfully Deleted the link. Please go to the <a href='delapp.php'>Delete link page</a><br> to Delete another link!"; } } else { ?> <br /><br /> <form action="delapp.php" method="post"> <div class="section_form"> <span style="float: left">Position:</span> <select name="apps"> <?php $apps_data = mysql_query("SELECT * FROM apps"); if(mysql_num_rows($apps_data) > 0) { while($a = mysql_fetch_array($apps_data)) { echo '<option value="'. htmlspecialchars($a['ign']) .'">'. htmlspecialchars($a['id']) .' - '. htmlspecialchars($a['ign']) .'</option>'; } } ?> Link to comment https://forums.phpfreaks.com/topic/191221-trying-to-make-a-application-deleter/ Share on other sites More sharing options...
Joshua F Posted February 7, 2010 Author Share Posted February 7, 2010 Bump. Link to comment https://forums.phpfreaks.com/topic/191221-trying-to-make-a-application-deleter/#findComment-1008554 Share on other sites More sharing options...
teamatomic Posted February 7, 2010 Share Posted February 7, 2010 OK. The name of your select is "apps", why $_POST['ign']? HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/191221-trying-to-make-a-application-deleter/#findComment-1008560 Share on other sites More sharing options...
Joshua F Posted February 7, 2010 Author Share Posted February 7, 2010 Hmm, I don't get it. I have this as my code now... <?php if(isset($_SESSION['admin'])){ if($_SERVER['REQUEST_METHOD'] == 'POST') { if( $_POST['apps'] == "") { echo "You have left 1 or more boxes empty!"; } else { mysql_query("DELETE FROM apps WHERE ign=" . realEscape($_POST["ign"]) . ""); echo "You have successfully Deleted the link. Please go to the <a href='delapp.php'>Delete link page</a><br> to Delete another link!"; } } else { ?> <br /><br /> <form action="delapp.php" method="post"> <div class="section_form"> <span style="float: left">Application:</span> <select name="apps"> <?php $apps_data = mysql_query("SELECT * FROM apps"); if(mysql_num_rows($apps_data) > 0) { while($a = mysql_fetch_array($apps_data)) { echo '<option value="'. htmlspecialchars($a['ign']) .'">'. htmlspecialchars($a['id']) .' - '. htmlspecialchars($a['ign']) .'</option>'; } } ?> Still get same error, and ideas? Link to comment https://forums.phpfreaks.com/topic/191221-trying-to-make-a-application-deleter/#findComment-1008577 Share on other sites More sharing options...
teamatomic Posted February 8, 2010 Share Posted February 8, 2010 Do a print_r on your _POST['apps'] and show what it is. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/191221-trying-to-make-a-application-deleter/#findComment-1008607 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.