本文整理匯總了PHP中UserClass::setInDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserClass::setInDB方法的具體用法?PHP UserClass::setInDB怎麽用?PHP UserClass::setInDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserClass
的用法示例。
在下文中一共展示了UserClass::setInDB方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: myProfil
function myProfil()
{
global $navegador;
global $user;
global $connection;
$titulo = 'David\'s SHOP - My Profile';
$description = '';
$palabrasClaves = 'palabrasClaves';
$from = false;
if ($user == '') {
require_once '../../Model/UserClass.php';
$user = new UserClass($connection);
// var_dump($user);
$from = true;
}
if (!empty($_POST)) {
if ($_POST['button'] == 'Save') {
if (!filter_var($_POST['Email'], FILTER_VALIDATE_EMAIL)) {
echo '<script>alert("Error : Email not valid")</script>';
$from = true;
} else {
if (preg_match("/^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}\$/", $_POST['Birthdate']) === 0) {
echo '<script>alert("Error : Date not valid")</script>';
}
// $user->user = $_POST['name'];
// $user->pass = $_POST['LastName'];
$user->name = $_POST['name'];
$user->lastName = $_POST['LastName'];
$user->date = $_POST['Birthdate'];
$user->email = $_POST['Email'];
$user->sexe = $_POST['Gender'];
$user->address = $_POST['Address'];
$user->user = $_POST['userName'];
$user->pass = $_POST['Password'];
// $user->roll = $_POST[''];
$id = $user->setInDB();
if ($id != 0) {
$_SESSION['idRow'] = $id;
header('Location: ../Front/controller.php?f=index');
}
}
} elseif ($_POST['button'] == 'Change my data') {
$from = true;
} elseif ($_POST['button'] == 'Back') {
$from = false;
}
}
// var_dump($user);
require_once '../../View/Back/myProfil.php';
}