Well I am currently working on a Auth panel for me and my friend.. but i got stuck on the delete option of deleting the auth... please review my files and see if you can be any help...
delusers.php
<?php
if(($username = strtolower($_POST['username'])) == "")
{
$username = strtolower($_GET['username']);
}
if(($ip = strtolower($_POST['ip'])) == "")
{
$ip = strtolower($_GET['ip']);
}
if(($comments = strtolower($_POST['comments'])) == "")
{
$comments = strtolower($_GET['comments']);
}
if($username != "" || $ip != "" || $comments != "")
{
echo '<html>';
echo '<head>';
echo '<title>Scripter\'s Panel V0.1 :: Viewing ' . $username . '</title>';
echo '</head>';
echo '<body bgcolor="CCCCCC" alink="FFFFFF" vlink="FFFFFF" link="FFFFFF">';
echo '<center>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<table height="97" width="550" border="0">';
echo '<img src="./images/Logo.gif" border="0">';
echo '</table>';
echo '<table hieght="" width="550" border="0" background="./images/Middle.gif">';
echo '<form action="deluser.php" method="post">';
echo '<img src="./images/Header.gif" border="0"><br>';
echo '<td>';
echo '<center>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<b>Username:</b> ' . $username . '<br>';
echo '<b>IP Address:</b> ' . $ip .'<br>';
echo '<b>Comments:</b> ' . $comments . '<br><br>';
echo '<input type="submit" name="del" value="Delete Auth"><br>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<center><a href="delauths.php?username=' . $username . '">Delete Another Auth</a></center><br>';
echo '<center><a href="panel.php">Go Back</a></center>';
echo '<br>';
echo '</center>';
echo '</td>';
echo '</form>';
echo '</table>';
echo '<img src="./images/Footer.gif" border="0">';
echo '</center>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '</body>';
echo '</html>';
}
?>
delusers.php
<?php
include('../config.php');
echo '<html>';
echo '<head>';
echo '<title>Scripter\'s Panel V0.1 :: Delete Auths</title>';
echo '</head>';
echo '<body bgcolor="CCCCCC" alink="FFFFFF" vlink="FFFFFF" link="FFFFFF">';
echo '<center>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<table height="97" width="550" border="0">';
echo '<img src="./images/Logo.gif" border="0">';
echo '</table>';
echo '<table hieght="" width="550" border="0" background="./images/Middle.gif">';
echo '<img src="./images/Header.gif" border="0"><br>';
echo '<img src="./images/DeleteAuthsImage.gif" border="0" width="550"><br>';
echo '<td>';
echo '<center>';
echo '<br>';
echo '<br>';
echo '<br>';
if($connect = mysql_connect($dbhost,$dbuser,$dbpass))
{
mysql_select_db($dbname);
$query = mysql_query('SELECT * FROM auths');
while($array = MySQL_fetch_array($query))
{
echo '<center><a href="delusers.php?username='.$array[username].'&ip='.$array[ip].'&comments='.$array[comments].'">'.$array[username].'</a></center><br>';
}
}
echo '<br>';
echo '<br>';
echo '<br>';
echo '<center><a href="panel.php">Go Back</a></center>';
echo '<br>';
echo '</center>';
echo '</td>';
echo '</table>';
echo '<img src="./images/Footer.gif" border="0">';
echo '</center>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '</body>';
echo '</html>';
?>
deluser.php
<?php
if(($username = strtolower($_POST['username'])) == "")
{
$username = strtolower($_GET['username']);
}
include("../config.php");
echo '<html>';
echo '<head>';
echo '<title>Scripter\'s Panel V0.1 :: Deleting ' . $username . ' from auth system</title>';
echo '</head>';
echo '<body bgcolor="CCCCCC" alink="FFFFFF" vlink="FFFFFF" link="FFFFFF">';
echo '<center>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '<table height="97" width="550" border="0">';
echo '<img src="./images/Logo.gif" border="0">';
echo '</table>';
echo '<table hieght="" width="550" border="0" background="./images/Middle.gif">';
echo '<img src="./images/Header.gif" border="0"><br>';
echo '<td>';
echo '<center>';
echo '<br>';
echo '<br>';
echo '<br>';
if($con = mysql_connect($dbhost,$dbuser,$dbpass))
{
mysql_select_db($dbname);
$query = mysql_query('DELETE FROM auths WHERE (`username`) VALUES(\''.$username.'\');');
echo '<center><b>' . $username . ' deleted succesfully.</b></center>';
}
else
{
echo '<center><b>There was a error deleting the specified auth...</b></center>';
}
echo '<br>';
echo '<br>';
echo '<br>';
echo '<center><a href="delauths.php">Delete Another Auth</a></center><br>';
echo '<center><a href="panel.php">Go Back</a></center>';
echo '<br>';
echo '</center>';
echo '</td>';
echo '</table>';
echo '<img src="./images/Footer.gif" border="0">';
echo '</center>';
echo '<br>';
echo '<br>';
echo '<br>';
echo '</body>';
echo '</html>';
?>
the main page is delauths.php, it says it successfully deleted the auth but it doesn't really... the table 'auths' has the rows username, password, ip, comments, and rdate