<? include "conn.php"?>

<?

if($_POST[lid] && $_POST[lphone])
{
$q=mysql_fetch_array(mysql_query("select * from challenge4 where id='$_POST[lid]' and phone='$_POST[lphone]'"));



if(
$q[id])
{
$pw="????";

echo(
"id : $q[id]<br>lv : $q[lv]<br><br>");

if(
$q[lv]=="admin")
{
echo(
"<b>Password is $pw</b><br><br>");
mysql_query("delete from challenge4");
}

echo(
"<a href=index.php>back</a>");
exit();
}

}


if(
$_POST[id] && $_POST[phone])
{
if(
strlen($_POST[phone])>=20) exit("Access Denied");
if(
eregi("admin",$_POST[id])) exit("Access Denied");
if(
eregi("load|admin|0x|#|hex|char|ascii|ord|from|select|union|infor|challenge",$_POST[phone])) exit("Access Denied");

@
mysql_query("insert into challenge4 values('$_POST[id]',$_POST[phone],'guest')");
}

?>

<form method=post action=index.php>
<table border=1>
<tr><td>JOIN</td><td><input name=id></td><td><input name=phone></td><td rowspan=2><input type=submit style=height:50></td></tr>
<tr><td>LOGIN</td><td><input name=lid></td><td><input name=lphone></td></tr>
</table>
</form>
<br><center><a href=index.phps>source</a>