Пример #1
0
}
$_user = "******";
$edtuid = $_POST['edtuid'];
$rid = $_POST['rid'];
$uname = $_POST['username'];
$email = $_POST['email'];
$rname = $_POST['rnum'];
$ext = $_POST['ext'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
if ($vobj->ifUserExists($uname)) {
    echo "Ussser already exists";
    exit;
}
if ($vobj->ifEmailExists($email)) {
    echo "email already exists";
    exit;
}
// if($pwd != $cpwd){
// 	echo "Passwords did not match";
// 	exit;
// }
if (!$vobj->ifRoomExists($rname)) {
    echo "Room number : " . $uname . " does not exists in the system";
    exit;
}
$rid = $dbobj->getRoomId($rname);
echo "before";
$dbobj->Update("update user set `uname`='{$uname}',`email`='{$email}',`rid`='{$rid}',`ext`='{$ext}' where `uid`='{$edtuid}'");
echo "after";
header("location:" . $_user);
Пример #2
0
    echo "User already exists";
    exit;
}
if ($vobj->ifEmailExists($email)) {
    echo "email already exists";
    exit;
}
if ($pwd != $cpwd) {
    echo "Passwords did not match";
    exit;
}
if (!$vobj->ifRoomExists($rnum)) {
    echo "Room number : " . $rnum . " does not exists in the system";
    exit;
} else {
    $rid = $dbobj->getRoomId($rnum);
}
// if($vobj->ifExtExists($ext)){
// 	echo "User already exists";
// 	exit;
// }
// upload image
$target_dir = "../images/user/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);
$imgname = $uname . "." . $imageFileType;
$target_file = $target_dir . $imgname;
// Check if image file is a actual image or fake image
if (isset($_POST["submit"])) {
    $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);