View file release_fix#2/api/getguildbyuser.php

File size: 878B
<?php
include "../connect.php";
$api_key=$_GET['ak'];
$user=$_GET['u'];
$login_test="";
$query = "SELECT * FROM users WHERE login='$user'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online,$exp,$guild) = mysql_fetch_row($cat))
{
$login_test="ok";
}
if($login_test=="ok")
{
if($api_key==md5($user))
{
$us=$_GET['u'];
$ol="";
$query3 = "SELECT * FROM users WHERE login='$us'";
$cat3 = mysql_query ($query3);
if(!$cat3) exit (mysql_error());
while(list($id4,$login4,$pass4,$mail4,$reg4,$class4,$m4,$h4,$z4,$s4,$mon4,$gold4,$pms4,$lvl4,$ava4,$ban4,$online,$exp4,$guild4) = mysql_fetch_row($cat3))
{
if($online=="no")
{
$ol="off";
}
else
{
$ol="on";
}
echo "$guild4";
}
}
else
{
echo "key_error";
}
}
else
{
echo "auth_error";
}
?>