当前位置: 首页>>代码示例>>PHP>>正文


PHP users::insert方法代码示例

本文整理汇总了PHP中users::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP users::insert方法的具体用法?PHP users::insert怎么用?PHP users::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在users的用法示例。


在下文中一共展示了users::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: new_user

 public function new_user()
 {
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     $nickname = '';
     $user = new users();
     if ($user->has($username)) {
         echo 1;
         return;
     }
     $suc = $user->insert($username, $password, $nickname);
     $_SESSION['uid'] = $user->id;
     $_SESSION['uname'] = $user->username;
     return $suc ? 0 : 1;
 }
开发者ID:FebV,项目名称:forum,代码行数:15,代码来源:userController.php

示例2: users

<?php

if ($_POST) {
    include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/user.php';
    $users = new users($db);
    $users->username = $_POST['username'];
    $users->password = $_POST['password'];
    $users->userlevel = $_POST['userlevel'];
    $users->isactive = 0;
    $users->insert();
    header("refresh: 0");
}
?>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
				<h4 class="modal-title" id="myModalLabel">Tambah Data User</h4>
			</div>
		<div class="modal-body">
			<form class="form-horizontal" action="" method="post">
				<div class="row">
				
				<div class="form-group">
					<label class="col-md-3 control-label" for="username">User Name</label>
					<div class="col-md-7">
						<input type="text" id="username" name="username" placeholder="Masukan Username/nama pegawai" class="form-control" required>
					</div>
				</div>
				
开发者ID:ilhamdoanggg,项目名称:penjualan_salon,代码行数:30,代码来源:modalinsert.php

示例3: header

if (!empty($a)) {
    echo '$a is !empty';
    $valSurname = $a[0];
    $valName = $a[1];
    $valFname = $a[2];
}
//делаю апдейт
$b = $new->updateById($id);
if ($b == 1) {
    header("Location: http://site.dev/class/class.php");
    $valSurname = '';
    $valName = '';
    $valFname = '';
}
//вношу данные
$c = $new->insert();
//удаляю данные
$d = $new->delete($id);
//вытаскиваю всю базу
$all = $new->selectAll();
//Создаю заголовки таблицы и добавляю их в массив таблицы
$head = ['id' => 'ID', 'surname' => 'SURNAME', 'nam' => 'NAME', 'fname' => "FATHER'S NAME", 'bdel' => 'DELETE', 'up' => 'UPDATE'];
array_unshift($all, $head);
//создаю ссылки для апдейта и делита и добавляю их в массив таблицы
for ($t = 1; $t < count($all); $t++) {
    $del[$t] = '<a href="http://site.dev/class/class.php?action=delete&id=' . $all[$t]['id'] . '">DELETE</a>';
    $up[$t] = '<a href="http://site.dev/class/class.php?action=update&id=' . $all[$t]['id'] . '">UPDATE</a>';
}
for ($m = 1; $m < count($all); $m++) {
    $all[$m]['del'] = $del[$m];
    $all[$m]['up'] = $up[$m];
开发者ID:aiskimzhi,项目名称:site.dev,代码行数:31,代码来源:class.php

示例4: users

echo '</pre>';
echo '<pre>';
print_r($_POST);
echo '</pre>';
$new = new users();
echo 'table name is ' . $new->tableName() . '<br>';
if (isset($_GET['id'])) {
    $id = $_GET['id'];
} else {
    $id = 0;
}
echo 'id = ' . $id . '<br>';
$sellect = $new->selectForUpdate($id);
$update = $new->updateById($id);
$delete = $new->delete($id);
$insert = $new->insert();
$sellectAll = $new->selectAll();
?>

<!DOCTYPE HTML>
<html>
<head>
    <title>Class work</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="bootstrap.css">
    <script type="text/javascript" scr="bootstrap.js"></script>
</head>
<body>
<h4>Please, enter your data into the form below</h4>
    <form action="class.php" method="POST">
        Enter your surname: <input type="text" name="surname"><br>
开发者ID:aiskimzhi,项目名称:site.dev,代码行数:31,代码来源:class.php


注:本文中的users::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。