本文整理汇总了PHP中UserClass::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP UserClass::insert方法的具体用法?PHP UserClass::insert怎么用?PHP UserClass::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserClass
的用法示例。
在下文中一共展示了UserClass::insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SignupForm
<?php
include_once 'common/base.php';
/*
*check if the form is submitted, and verify and register
*if not then print the form
*/
$title = "signUp";
include_once 'common/header.php';
include_once './forms/form.signup.php';
$form = new SignupForm($db);
if ($form->read()) {
//echo "The form is submitted.";
if ($form->isValid()) {
//echo "<br/>The form is valid";
$fields = $form->getArray();
include_once './models/class.users.php';
$user = new UserClass($db);
if ($user->insert($fields)) {
echo "<div id='note'>\n\t\t \t\t\t\t\t\t\t\t<p>Congratulation. You are registered.</p>\n\t\t \t\t\t\t\t\t\t\t<p><a href='./login.php'>Login</a></p>\n\t\t \t\t\t\t\t\t\t</div>";
}
} else {
//echo "<br/>form is invalid.";
$form->display();
}
} else {
//echo "The signup is not posted.";
$form->display();
}
$footer = "copyright © 2012 reserved to rajan prasad upadhyay.";
include_once './common/footer.php';