コード例 #1
0
ファイル: register.php プロジェクト: expl0iit/quatro
<?php

$place = $_POST['lang'];
include_once "./incl/creds.php";
include_once "./incl/secinf.php";
include get_lang_file($place);
$link = mysqli_connect($sql_host, $sql_user, $sql_pass, $sql_db);
$place = mysqli_escape_string($link, $_POST['lang']);
$name = preg_replace("/[^a-zA-Z0-9-._]/", "", mysql_escape_string(strtolower($_POST['usr'])));
if (strlen($name) < 3) {
    header("Location:index.php?bad={$badName}");
    die;
}
$pass = crypt($_POST['pwd'], '$2y$07$' . $salt . '$');
$quer = mysqli_query($link, "SELECT * FROM users WHERE username='******'");
if (mysqli_num_rows($quer) != 0) {
    mysqli_close($link);
    header("Location:index.php?bad={$accountAlreadyExists}");
    die;
} else {
    mysqli_query($link, "INSERT INTO users (username,password,friends,avatar,lang) VALUES ('" . $name . "','" . $pass . "', ',', '', '" . $place . "')");
    if ($place == "PL") {
        mysqli_query($link, "INSERT INTO posts (`author`,`note`,`post`) VALUES ('{$name}','1','<a href=\"u-{$name}\">@{$name}</a> dolaczyl/a do Quatro!')");
        header("Location:index.php?good=Witaj {$name}, mozesz sie juz zalogowac.");
    } else {
        mysqli_query($link, "INSERT INTO posts (`author`,`note`,`post`) VALUES ('{$name}','1','<a href=\"u-{$name}\">@{$name}</a> joined Quatro!')");
        header("Location:index.php?good=Hello {$name}, you can now log in.");
    }
}
mysqli_close($link);
コード例 #2
0
ファイル: index.php プロジェクト: expl0iit/quatro
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="description" content="Quatro is an anonymous, easy-to-use social networking site." />
        <meta name="keywords" content="quatro, anonymous, anonimowy, portal, spolecznosciowy, spolecznosciowy, social, share" />
        <meta name="robots" content="index, nofollow" />
	    <meta name="revisit-after" content="1 month">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" type="text/css" href="img/css.css">
        <title>Quatro</title>
        <?php 
include "./incl/tools.php";
include get_lang_file(get_loc());
?>
    </head>
    <body>
        <div class="box">
            <img src='img/greylogo.gif' alt='Quatro' title='Hey, get off me!' />
            <div class="header"><?php 
echo $slogan;
?>
</div>
            <?php 
if (isset($_GET['good'])) {
    echo "<div class=\"good\">" . htmlspecialchars($_GET['good']) . "</div>";
}
if (isset($_GET['bad'])) {
    echo "<div class=\"bad\">" . htmlspecialchars($_GET['bad']) . "</div>";