if (!isset($_SESSION["id"])) { die("ERROR ON PAGE!"); } $id = $_SESSION["id"]; if (!isset($_POST["action"])) { die("ERROR"); } $action = $_POST["action"]; //two actions: if ($action == "editName") { if (!isset($_POST["pass"])) { die("ERROR"); } /// $name = trim($_POST["pass"]); if (cn_name_input_validate($name) and strlen($name) >= 4) { $query = "\n\t\t\tUPDATE membership_ipn\n\t\t\tSET real_name = '{$name}'\n\t\t\tWHERE user_id = {$id}\n\t\t"; $result = mysql_query($query); } /// } else { if ($action == "editPhone") { if (!isset($_POST["pass"])) { die("ERROR"); } $phone = trim($_POST["pass"]); if (lib_number_validate($phone) and strlen($phone) >= 9 and strlen($phone) <= 11) { $query = "\n\t\t\tUPDATE membership_ipn\n\t\t\tSET phone = '{$phone}'\n\t\t\tWHERE user_id = {$id}\n\t\t"; $result = mysql_query($query); } ///
$E_mail = trim($_POST["Email"]); $code = trim($_POST['Verifycode']); //check username's length: if (strlen($usr) < 6 or strlen($usr) > 30) { die("<h3>Error page!</h3>"); } //check password's length: if (strlen($psw) < 6 or strlen($psw) > 20) { die("<h3>Error page!</h3>"); } //check if passwords match: if ($psw != $repsw) { die("<h3>Error page!</h3>"); } //check username input validation: if (!cn_name_input_validate($usr)) { die("<h3>Error page!</h3>"); } //check password input validation: if (!lib_psw_validate($psw)) { die("<h3>Error page!</h3>"); } if (!lib_email_validate($E_mail)) { die("<h3>Error page!</h3>"); } //check if name is avalable: if (isUserExist($usr, $psw)) { die("<h3>Error page!</h3>"); } if (!lib_parseInteger($code)) { die("<h3>Error page!</h3>");