本文整理匯總了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';