use foundationphp\OCI; require_once 'src/foundationphp/UploadFile.php'; session_start(); $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $password = $_POST['password']; $cpassword = $_POST['cpassword']; $sex = $_POST['sex']; $soal = $_POST['soal']; $javab = $_POST['javab']; $codemelli = $_POST['codemelli']; $father = $_POST['father']; $year = $_POST['year']; $month = $_POST['month']; $day = $_POST['day']; $oci = new OCI(); $checkcodemelli = false; if (empty($_POST["codemelli"])) { echo "کد ملی باید وارد شود"; echo "<br>"; echo "operation failed"; exit; } elseif (!preg_match("/^[0-9 ]*\$/", $_POST["codemelli"])) { echo "کد ملی باید رقم باشد"; } elseif (strlen($_POST["codemelli"]) != 10) { echo "کد ملی باید ده رقم باشد"; } elseif (preg_match("([0]{10}|[1]{10}|[2]{10}|[3]{10}|[4]{10}|[5]{10}|[6]{10}|[7]{10}|[8]{10}|[9]{10})", $_POST["codemelli"])) { echo "اعداد کد ملی نمی توانند برابر هم باشند"; } else { $code = test_codemelli($_POST["codemelli"]); if (!$code) {
<?php namespace foundationphp; ?> <html> <head> <meta charset="UTF-8"> </head> <body> <?php // Create connection use foundationphp\OCI; require_once 'src/foundationphp/OCI.php'; $oci = new OCI(); session_start(); if (isset($_SESSION['myusername'])) { $id = $_SESSION['myusername']; $idmd5 = encrypt($id, $id); $row = $oci->fetchArray("T1_1", "T5_3", "T5", "T1", "T1_1", "T5", "T5_1", $idmd5); while ($row) { echo "id: " . decrypt($row["T1_1"], $id) . " Name: " . decrypt($row["T1_2"], $id) . "Last name: " . decrypt($row["T1_3"], $id) . "Email:" . decrypt($row["T5_3"], $id) . "<br>"; } } function encrypt($data, $secret) { //Generate a key from a hash $key = md5(utf8_encode($secret), true); //Take first 8 bytes of $key and append them to the end of $key. $key .= substr($key, 0, 8); //Pad for PKCS7
<html> <head> <meta charset="UTF-8"> </head> <body> <?php use foundationphp\OCI; require_once 'src/foundationphp/OCI.php'; //خوندن اطلاعات یه صورت کد $myusername = encrypt($_POST['myusername'], $_POST['myusername']); $mypassword = encrypt($_POST['mypassword'], $_POST['myusername']); $userCaptcha = $_POST['captcha']; $id = $_POST['id']; $wrong = 0; $oci = new OCI(); session_start(); //چک کردن متن کپچا if ($_SESSION['captcha'] == $userCaptcha) { //چک کردن این که تمامی فیلدها یر شده یاشه if (!empty($_POST['myusername']) && !empty($_POST['mypassword'])) { //چک کردن اینکه اطلاعات قیلا ثیت شده یاشد //چک کردن یوزرنیم براساس حقیقی یا حقوقی if ($id == 'idcodemelli') { $count = $oci->fetchRow2("*", "T3", "T3_1", $myusername, "T3_3", $mypassword); } else { $count = $oci->FetchRow2("*", "T3", "T3_2", $myusername, "T3_3", $mypassword); } if ($count != 0) { $_SESSION["myusername"] = $myusername; $_SESSION["mypassword"] = $mypassword;
protected function saveAndMoveFile($file, $codemelli, $Tb_name, $CL_name, $ID_name, $ID_value) { $filename = isset($this->newName) ? $this->newName : $file['name']; $success = move_uploaded_file($file['tmp_name'], $this->destination . $filename); if ($success) { $result = $file['name'] . ' was uploaded successfully'; if (!is_null($this->newName)) { $result .= ', and was renamed ' . $this->newName; } $result .= '.'; $this->messages[] = $result; $tempt = $this->destination . $filename; $save = new OCI(); $save->updatefile($Tb_name, $CL_name, $tempt, $ID_name, $ID_value); } else { $this->messages[] = 'Could not upload' . $file['name']; } }
<?php namespace foundationphp; ?> <html> <head> <meta charset="UTF-8"> </head> <body> <?php use foundationphp\OCI; require_once 'src/foundationphp/OCI.php'; $oci = new OCI(); if (isset($_POST['submit'])) { $codemelli = $_POST['codemelli']; $email = $_POST['email']; $cemail = $_POST['cemail']; $checkcodemelli = false; //$n = strtotime("Now"); $timeh = strtotime("-1 minute"); $checkp = $oci->fetchRowNull("T1_1", "T1", "T1_3"); if ($checkp != 0) { $IDvalue = $oci->fetchDel("T1_1", "T1", "T1_18", $timeh); $oci->delete("T5", "T5_1", $IDvalue); $oci->deleteDate("T1", "T1_18", $timeh); } //چک کردن اینکه فیلد کد ملی حتما باید بر شده باشد در غیر این صورت قادر به ادامه ی کار نخواهد بود if (empty($_POST["codemelli"])) { echo "کد ملی باید وارد شود";