session_start();
include "s.php";
if (isset($_SESSION["logged"])) {
if (isset($_POST["klanadi"])) {
if (!(strlen($_POST["klanadi"]) < 3)) {
$q = mysql_query("select * from kullanicilar where kullanici = '" . $_SESSION["user"] . "'");
if (mysql_num_rows($q) > 0) {
$row = mysql_fetch_assoc($q);
if ($row["klan"] == "yok") {
$q1 = mysql_query("select * from klanlar where ad = '" . $_POST["klanadi"] . "'");
if (mysql_num_rows($q1) > 0) {
echo "mklan";
} else {
@mysql_query("INSERT INTO `klanlar` VALUES ('" . $_POST['klanadi'] . "', 1, '" . $_SESSION['user'] . "', '" . $_SESSION['user'] . ",', 0);");
@mysql_query("UPDATE kullanicilar SET klan = '" . $_POST["klanadi"] . "|1',davetler = 'yok' WHERE kullanici = '" . $_SESSION["user"] . "'");
echo "basarili";
}
} else {
echo "zklan";
}
}
} else {
echo "gklan";
}
}
}

?>