Jump to content

Trying to make a Application Deleter..


Joshua F

Recommended Posts

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

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?

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.