コード例 #1
0
ファイル: index.php プロジェクト: bspavel/regForm
//get data
$getPostDt = new getpostdt();
$pgType = $getPostDt->getPgtype(@$_POST["viewPage"], @$_GET["viewPage"]);
$lg = $getPostDt->getLg(@$_POST["lg"], @$_GET["lg"]);
$valid = new validation();
$fDt = $valid->fillarrData(@$_POST["Dt"]);
//********************************************************************
$db = new db();
$lgArr = $valid->logPassDt(@$_POST["enter"]["login"], @$_POST["enter"]["password"]);
if ($lgArr['check']) {
    $profiledt = $db->getData($lgArr['login'], $lgArr['password']);
    $fphoto = $profiledt["fphoto"];
}
if ("reg" == $pgType) {
    if ($fDt['check']) {
        if ($valid->photo($_FILES["fphoto"])) {
            $img = new photo($_FILES["fphoto"]);
            $db->insertDt($fDt, $img->imgBase64);
            $profiledt = $db->getData();
            $fphoto = $img->imgBase64;
        }
    }
}
if ($db->getUid() > 0) {
    $pgType = "profile";
    $_SESSION['loginArr'] = $profiledt;
    $_SESSION['photo'] = $fphoto;
}
if (!empty($_SESSION['photo'])) {
    $profiledt = $_SESSION['loginArr'];
    $fphoto = $_SESSION['photo'];