コード例 #1
0
ファイル: networks-add.php プロジェクト: joksnet/php-old
<?php

$root = realpath(dirname(__FILE__));
include_once "{$root}/config.php";
include_once "{$root}/common.php";
if (!dhIsLogin()) {
    dhRedirect('index');
}
if (dhIsPost()) {
    if (dhValid(array('netname' => 'required'))) {
        $netname = dhPost('netname', 'WORKGROUP');
        dhQueryInsert('networks', array('id_users' => dhUID(), 'netname' => $netname, 'created' => time()));
        if (dhConfig('useModRewrite')) {
            dhRedirect('networks');
        } else {
            dhRedirect('networks', array('success' => urlencode($netname)));
        }
    }
}
dhTheme('networks-add');
コード例 #2
0
ファイル: register.php プロジェクト: joksnet/php-old
<?php

$root = realpath(dirname(__FILE__));
include_once "{$root}/config.php";
include_once "{$root}/common.php";
if (dhIsLogin()) {
    dhRedirect('index');
}
if (dhIsPost()) {
    $isValid = dhValid(array('fullname' => 'required', 'name' => 'required', 'pass' => 'required', 'pass2' => array('required' => true, 'equal' => 'pass'), 'question' => 'required', 'anwser' => 'required'));
    if ($isValid) {
        dhQueryInsert('users', array('fullname' => dhPost('fullname'), 'name' => dhPost('name'), 'pass' => md5(dhPost('pass')), 'question' => dhPost('question'), 'anwser' => dhPost('anwser'), 'register' => time()));
        dhRedirect('register-success', array('name', dhPost('name')));
    }
}
dhTheme('register');