Example #1
0
<?php

/**
 * Created by PhpStorm.
 * User: hssh_win8.1
 * Date: 2015/10/5
 * Time: 11:45
 * file: cateaddhandle.php  处理添加栏目
 */
require_once './common/include.php';
// 获取数据库实例
$mu = new ModelUser('bl_cate');
// 获得插入的数据
$arr = array('cate_name' => $_POST['cate_name'], 'parent_id' => $_POST['parent_id'], 'cate_desc' => $_POST['cate_desc']);
$res = $mu->insert($arr);
// 失败
if ($res != 1) {
    echo "1";
} else {
    echo "0";
}
Example #2
0
        $username = $_POST['username'];
    }
    $sql = "select count(*) from bl_user where username='******'";
    $res = $mu->getOne($sql);
    if ($res != 0) {
        // 重复
        echo "1";
        return;
    } else {
        echo "0";
        return;
    }
} else {
    if ($type == 'register') {
        $data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'email' => $_POST['email']);
        $res = $mu->insert($data);
        if ($res != 1) {
            echo "1";
            return;
        } else {
            // 注册成功
            //smtp服务器
            $as = array("user" => "*****@*****.**", "password" => "a19940622");
            // 发件邮箱
            $af = array("add" => "*****@*****.**", "name" => "from " . '便利店');
            // 收件邮箱
            $at = array("add" => $data["email"], "name" => "to hssh");
            // 邮件主题
            $title = "欢迎注册成为便利店会员 请激活";
            // 邮件内容body
            $url = "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . '/registeractive.php';
Example #3
0
<?php

require_once 'head.php';
require_once 'conexao.php';
require_once 'ModelUser.php';
$usuario = new ModelUser($conexao);
if (isset($_GET['nomeUserIncluido'])) {
    $usuario->setNome($_GET['nomeUserIncluido']);
    $usuario->setSenha($_GET['senhaUserIncluida']);
    $usuario->insert();
} else {
    echo '<h5>Nao ha dados para inclusao! Retorne para a area administrativa para realizar um novo cadastro.</h5>';
}
echo '<h3>Os dados do aluno ' . $usuario->busca($_GET['nomeUserIncluido'])['nome'] . ' foram incluidos com sucesso! Abaixo os dados incluidos:</h3>';
echo '<table class="table table-striped">
	<tr>
		<th>NOME</th>
		<th>SENHA</th>
	</tr>';
echo '<tr>';
echo '<td>' . $usuario->busca($_GET['nomeUserIncluido'])['nome'] . '</td>';
echo '<td>' . $usuario->busca($_GET['nomeUserIncluido'])['senha'] . '</td></tr>';
echo '<tr>';