Ejemplo n.º 1
0
include_once "{$root}/config.php";
include_once "{$root}/common.php";
if (Session::$logged) {
    header("Location: {$config['root']}dd/");
}
$title = __('SignUpTitle');
$error = array();
if (isset($_GET['email']) && isEmail($_GET['email'])) {
    $email = $_GET['email'];
}
if (!empty($_POST)) {
    $email = strtolower($_POST['email']);
    $password = $_POST['password'];
    $passwordagain = $_POST['passwordagain'];
    $captcha = strtolower($_POST['captcha']);
    if (!Session::captchaCompare('signup', $captcha)) {
        $error['captcha'] = true;
    }
    if (!isEmail($email)) {
        $error['email'] = true;
    }
    if (strlen($password) < 6) {
        $error['password'] = true;
    }
    if ($passwordagain != $password) {
        $error['passwordagain'] = true;
    }
    if (empty($error)) {
        $emailexists = Db::fetchOne("SELECT email FROM users\n             WHERE email = '{$email}'");
        if (!empty($emailexists)) {
            $error['email'] = true;
Ejemplo n.º 2
0
<?php

$root = '.';
include_once "{$root}/config.php";
include_once "{$root}/common.php";
$title = __('TLDsSuggest');
if (!empty($_POST)) {
    $domain = $_POST['domain'];
    $description = $_POST['description'];
    $captcha = strtolower($_POST['captcha']);
    if (substr($domain, 0, 1) == '.') {
        $domain = substr($domain, 1);
    }
    $domain = strtolower($domain);
    if (!Session::captchaCompare('tldssuggest', $captcha)) {
        $error['captcha'] = true;
    }
    if (strlen($domain) < 2 || !isTLD($domain)) {
        $error['domain'] = true;
    }
    if (!empty($description) && strlen($description) > 140) {
        $error['description'] = true;
    }
    if (empty($error)) {
        $tldexists = Db::fetchOne("SELECT domain FROM tlds\n             WHERE LCASE(domain) = '{$domain}'");
        if (!empty($tldexists)) {
            $error['domainexists'] = true;
        }
    }
    if (empty($error)) {
        Db::insert('tlds', array('domain' => $domain, 'description' => $description, 'suggest' => 1));