本文整理汇总了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';
}