function signUp() { if (!empty($_POST['username'])) { $checkUser = $_POST['username']; unset($query); $query = "select * from users where username = '******'"; $stmt = sqlsrv_query($GLOBALS['conn'], $query); $record = sqlsrv_has_rows($stmt); if (!$record) { $this->regUser(); } else { //echo "Sorry! You are already registered."; sqlsrv_close($GLOBALS['conn']); die(print_r(sqlsrv_errors(), true)); } } if (isset($_POST['submit'])) { echo "Submit call"; signUp(); } }
$requestMethod = $_SERVER["REQUEST_METHOD"]; if (!($requestMethod == 'GET')) { exit; } if (isset($_GET['action'])) { if ($_GET['action'] == 'sessionStatus') { sessionStatus(); } if ($_GET['action'] == 'login') { login($mysqli); } if ($_GET['action'] == 'logout') { logout(); } if ($_GET['action'] == 'signUp') { signUp($mysqli); } } /******************************* Functions *********************************/ function connectDatabase() { $mysqli = new mysqli("oniddb.cws.oregonstate.edu", "johnsjo3-db", $ecret, "johnsjo3-db"); if ($mysqli->connect_errno) { sendError("Failed to connect to database (" . $mysqli->connect_errno . ") " . $mysqli->connect_error); exit; } return $mysqli; } function sessionStatus()
function coreUserAction($vCodeCorrect = true) { global $CoreUserPasswordSecret, $CoreUserPasswordColumn; checkRequireField(array("Action")); $action = post("Action"); if ($action == "SignUp") { if ($vCodeCorrect === false) { printResultByMessage(getLanguageString("VCodeError"), 105); } $userName = post("UserName"); $email = post("Email"); $phoneNumber = post("PhoneNumber"); $password = post("Password"); $emailOrPhoneNumber = post("EmailOrPhoneNumber"); if ($emailOrPhoneNumber) { if (is_numeric($emailOrPhoneNumber)) { $phoneNumber = $emailOrPhoneNumber; } if (filter_var($emailOrPhoneNumber, FILTER_VALIDATE_EMAIL)) { $email = $emailOrPhoneNumber; } } $errorMessage = signUp($userName, $email, $phoneNumber, $password); if ($errorMessage) { if (function_exists("signupErrorOverride")) { signupErrorOverride($errorMessage); } else { printResultByMessage($errorMessage, 104); } } else { if (function_exists("signupOverride")) { signupOverride(getCoreUserInfo()); } else { printCoreUserInfo(); } } } else { if ($action == "Login") { if ($vCodeCorrect === false) { printResultByMessage(getLanguageString("VCodeError"), 105); } $usernameEmailPhoneNumber = post("UserNameOrEmailOrPhoneNumber"); $password = post("Password"); if (checkLogin($usernameEmailPhoneNumber, $password)) { if (function_exists("loginOverride")) { loginOverride(getCoreUserInfo()); } else { printCoreUserInfo(); } } else { if (function_exists("loginFailOverride")) { loginFailOverride(getLanguageString("LoginFail")); } else { printResultByMessage(getLanguageString("LoginFail"), 103); } } } else { if ($action == "ChangePassword") { if (!session("Uid")) { printResultByMessage(getLanguageString("ChangePasswordFail"), 107); } $oldPassword = md5(post("OldPassword") . $CoreUserPasswordSecret); $newPassword = md5(post("NewPassword") . $CoreUserPasswordSecret); $errorMessage = changePassword(session("Uid"), $oldPassword, $newPassword); if ($errorMessage) { printResultByMessage($errorMessage, 107); } else { printResultByMessage("", 0); } //click find password } else { if ($action == "ForgetPassword") { forgetPassword(); } else { if ($action == "ResetPassword") { if (!session("ResetPasswordUid")) { printResultByMessage(getLanguageString("ChangePasswordFail"), 106); } if (strlen(post("NewPassword")) < 5) { printResultByMessage(getLanguageString("PasswordTooShort"), 106); } $newPassword = md5(post("NewPassword") . $CoreUserPasswordSecret); $coreUserLink = connetCoreUserDB(); mysqli_query($coreUserLink, "update User set {$CoreUserPasswordColumn}='{$newPassword}' where Uid=" . session("ResetPasswordUid")); mysqli_query($coreUserLink, "delete from ForgetPassword where Uid = " . session("ResetPasswordUid")); if (mysql_error()) { printResultByMessage($errorMessage, 106); } else { printResultByMessage("", 0); } } } } } } }
function update() { global $readUsers, $getUser; foreach ($readUsers as $key => $dbUser) { if ($dbUser->name == $getUser->name) { $readUsers[$key]->score = $getUser->score; } } file_put_contents(DB_PATH, json_encode($readUsers, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); statusHelper('success', 'score обновлен на - ' . $getUser->score, $readUsers); die; } if ($formType == 'signin') { signIn(); } else { signUp(); } function signIn() { global $readUsers, $getUser; $getUser->password = sha1(AUTH_SECRET . $getUser->password); foreach ($readUsers as $readUser) { if ($readUser->name == $getUser->name && $readUser->password == $getUser->password) { unset($readUser->password); statusHelper("success", "Привет " . $getUser->name, $readUser); die; } } statusHelper("error", "Нет такого пользователя или пароль не верен - " . $getUser->name); } function signUp()
"AdditionalData":{ "UserData":{ "Username":"******", "Email":"*****@*****.**", "Password":"******" } } } }';*/ $json_register_data = file_get_contents('php://input'); $user_data = json_decode($json_register_data); $imei = $user_data->IMEI; require '../connection.php'; require 'functions.php'; if ($user_data->Username != '' && $user_data->Email != '' && $user_data->Password != '') { $reg_user = signUp($user_data, $imei, $conn); if ($reg_user == 10001) { $response = array('ResponseCode' => 10001, 'ResponseText' => 'Email already exist'); echo json_encode($response); } elseif ($reg_user == 10002) { $response = array('ResponseCode' => 10002, 'ResponseText' => 'Username already exist'); echo json_encode($response); } elseif ($reg_user == 10010) { $response = array('ResponseCode' => 10010, 'ResponseText' => 'Device already exist. Please register with some other device.'); echo json_encode($response); } elseif ($reg_user['ResponseCode'] == 11111) { $sql_getDefaultSection = "SELECT * \n FROM sections \n ORDER BY id \n LIMIT 1"; $res_getDefaultSection = $conn->query($sql_getDefaultSection); $section_id = ''; while ($row = $res_getDefaultSection->fetch_assoc()) { $section_id = $row['id'];
} } else { $returnData = array('error' => 'no-more'); } echo json_encode($returnData); } function signIn($username, $password) { $returnData = array('error' => 'no-error'); $query = "SELECT * from user where username = '******';"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { $returnData['error'] = 'no-user'; } else { $query = "SELECT * from user where username = '******' AND password = '******';"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { $returnData['error'] = 'wrong-password'; } else { $returnData['username'] = $username; } } echo json_encode($returnData); } if ($_GET['type'] == 'signup') { signUp($_GET['username'], $_GET['password']); } else { if ($_GET['type'] == 'sign-in') { signIn($_GET['username'], $_GET['password']); } }
require '../config/appconfig.php'; // DB Lib require "../libs/db/db.php"; // Distance Code require "../libs/distance.php"; // Action Find try { $pdo = openConnection($HOST, $DB, $USERNAME, $PASSWORD); $receiver = new SmsReceiver(); $message = $receiver->getMessage(); $mask = $receiver->getAddress(); $info = explode(' ', $message); $SUB_ID = "94771122336"; switch (strtoupper($info[1])) { case "SU": $reply = signUp($mask, $info, $pdo, getLoc($LBS_URL, $APP_INFO, $SUB_ID)); break; case "HELP": $reply = help(); break; case "LU": $reply = lookUp(getLoc($LBS_URL, $APP_INFO, $SUB_ID), $mask, $pdo, $SENDER_URL, $APP_INFO); break; case "BZ": $smask = getFMask($mask, $pdo); if ($smask == 'nill') { $reply = "You are not connected to anyone to BUZZ. Please try Looking Up for friends."; } else { $reply = "Your Friendstr is BUZZING you. Reply Back!"; $mask = $smask; }
</body> </html> <?php } else { if ($_POST['newid'] == '' or $_POST['newpwd'] == '' or $_POST['newname'] == '' or $_POST['newemail'] == '' or $_POST['newaddress'] == '') { c_error('One or more required fields were left blank.\\n' . 'Please fill them in and try again.'); } // here begin sanitize and password strengh $_POST['newid'] = sanitize($_POST['newid'], "id not valid"); $_POST['newname'] = sanitize($_POST['newid'], "name not valid"); $_POST['newaddress'] = sanitize($_POST['newaddress'], "address not valid"); if ($_POST['newnotes'] != '') { $_POST['newnotes'] = sanitize($_POST['newnotes'], "note not valid"); } $_POST['newemail'] = sanitize($_POST['newemail'], "email not valid"); if (!filter_var($_POST['newemail'], FILTER_SANITIZE_EMAIL)) { c_error_reporting(-1); c_error("email not valid"); } password_strength($_POST['newpwd']); // here everything have been check $success = signUp($_POST['newid'], $_POST['newpwd'], $_POST['newname'], $_POST['newemail'], $_POST['newaddress'], $_POST['newnotes']); if ($success == TRUE) { echo "<h4>Signed up!</h4>"; header("Refresh: 3; url=index.php?signed_up=1"); die; } }
setcookie('uid', null, 0); setcookie('aid', null, 0); header('Location: index.php?view=login'); } elseif ($_POST[action] != 'signup' && $_POST[action] != 'login') { $view = true; } } elseif ($_POST[action] != 'signup' && $_POST[action] != 'login') { $view = true; } if ($view) { $page = tabForm() . ($_GET['view'] == 'signup' ? signUpForm() : logInForm()); $title = $GLOBALS[LOCALE][$GLOBALS[LANG]][$_GET['view'] == 'signup' ? 'SIGNUP_TITLE' : 'LOGIN']; } else { switch ($_POST['action']) { case 'signup': if (signUp($db, $_POST[name], $_POST[day], $_POST[month], $_POST[year], $_POST[location], $_POST[status], $_POST[education], $_POST[expirience], $_POST[phone], $_POST[email], $_POST[description], $_POST[new_password], $_POST[verify_password], $GLOBALS[LANG])) { header('Location: index.php'); } else { header('Location: index.php?view=signup'); } break; case 'login': if (logIn($db, $_POST[email], $_POST[password])) { header('Location: index.php'); } else { header('Location: index.php?view=login'); } break; } } } else {
die('Invalid query: ' . mysqli_error($db)); } } else { echo "Your passwords do not match"; header("refresh:5;url=../views/register-form.php"); } } function signUp($db) { if (!empty($_POST['username'])) { $myusername = mysqli_real_escape_string($db, $_POST['username']); $mypassword = mysqli_real_escape_string($db, $_POST['password']); $sql = "SELECT user_id FROM user WHERE username = '******' and password = '******'"; $result = mysqli_query($db, $sql); if (!$result) { die('Invalid query: ' . mysqli_error($db)); } $row = mysqli_fetch_array($result, MYSQLI_ASSOC); $count = mysqli_num_rows($result); if ($count == 1) { echo "Sorry you are already a registered user"; echo "</br></br>This page will redirect in 5 seconds"; header("refresh:5;url=../views/register-form.php"); } else { newUser($db); } } } if (isset($_POST['register-submit'])) { signUp($db); }
?> <div class="my-nav"></div> <div id="content"> <div id="main-content"> <div class="col-sm-6"> <?php require_once LIBS_PATH . "recaptcha/ReCaptchaAutoload.php"; require_once CLASSES_PATH . "InfoManager.php"; if (isset($_POST["first_name"], $_POST["last_name"], $_POST["password"], $_POST["confirm_password"], $_POST["email"], $_POST["phone_number"], $_POST["gender"], $_POST["account_type"])) { $recaptcha = new \ReCaptcha\ReCaptcha($RECAPTCHA_SECRET_KEY); if (isset($_POST["g-recaptcha-response"])) { $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); if ($resp->isSuccess()) { $signup = signUp($_POST); if ($signup === true) { echo "<script>BootstrapDialog.alert('" . ACCOUNT_CREATION_SUCCESS . "\n" . VERIFICATION_EMAIL_SUCCESS . "');</script>"; } else { echo $signup; } } else { echo "An error occured with the ReCaptcha processing..."; } } } ?> </div> <br /> <br /> <form action="signup" method="post" enctype="multipart/form-data" class="form-horizontal" onsubmit="return checkValidSignupForm()">
<?php /* include the configuration and the functions files */ include './config.php'; include './dbAssistant.php'; /* Check if the session exists, if not start it */ if (session_status() == PHP_SESSION_NONE) { session_start(); } /* Catch the action sent from teh ajax request */ $action = filter_input(INPUT_POST, 'action'); if ($action == "signUp") { /* Encrypt the password */ $encryptedPassword = password_hash(filter_input(INPUT_POST, 'password'), PASSWORD_DEFAULT); /* Execute the function that inserts the user into teh database */ signUp(filter_input(INPUT_POST, 'username'), filter_input(INPUT_POST, 'email'), $encryptedPassword, $host, $dbUsername, $dbPassword, $dbName); }
<?php /* * SLOC API */ // set time zone date_default_timezone_set('Europe/Lisbon'); // get the function parameter from URL $params = $_REQUEST; switch ($params['func']) { case 'createAccount': createAccount($params); break; case 'signUp': signUp($params); break; case 'signUpAndMetaInfo': signUpAndMetaInfo($params); break; case 'metaInfo': metaInfo($params); break; case 'createDataFile': createDataInFile($params); break; case 'checkIn': checkIn($params); break; case 'setLocationData': setLocationData($params); break;
$response = ""; $avatar = ""; mysql_connect("localhost", $username, $password); @mysql_select_db($database) or die("Unable to select database"); if (isset($_POST['signup'])) { $email = htmlentities($_POST['email']); $password = htmlentities($_POST['user_pass']); $confirm_pass = htmlentities($_POST['user_pass_confirm']); $first_name = htmlentities($_POST['first_name']); $last_name = htmlentities($_POST['last_name']); $avatar = htmlentities($_POST['avatar']); if ($password != $confirm_pass) { $response = "password does not match the confimed password"; } else { $response = "password is good"; signUp($email, $password, $first_name, $last_name, $avatar); } } else { $response = "never entered"; } ?> <html> <head> <title>E-shop</title> <!-- {Bootstrap}--> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!--<link rel="stylesheet" href="styles/style.css" media="all" />--> </head> <body>
<div class="span6"> <h3>Signup Page</h3> <p><?php echo signUp(); ?> </p> <p>Here we show how the forms can be further seperated from the views and included. Remember everthing has to be passed through the main index.php page and any additional indexers you create. This goes for paths to styles, java, and links too.</p> <?php include 'f1/joiner.php'; ?> </div>
if (isset($_POST["formname"])) { switch ($_POST["formname"]) { case "login": /* Login */ $email = addslashes($_POST["email"]); $password = addslashes($_POST["password"]); $last_login = addslashes($_POST["last_login"]); loginUser($email, $password, $last_login); break; case "signup": /* Sign Up */ $username = addslashes($_POST["username"]); $email = addslashes($_POST["email"]); $counties = addslashes($_POST["counties"]); $password = addslashes($_POST["password"]); signUp($username, $email, $password, $counties); break; case "placead": /* Place AD */ $target_dir = "images/products/"; $target_file = $target_dir . basename($_FILES["main_picture"]["name"]); $fileExt = strtolower(pathinfo($target_file, PATHINFO_EXTENSION)); $filename = $target_dir . date("YmdHis") . $_SESSION["id_user"] . "." . $fileExt; #echo $filename; $uploadOk = 1; $check = getimagesize($_FILES["main_picture"]["tmp_name"]); if ($check !== false) { $uploadOk = 1; } else { $uploadOk = 0; }
$avatar = ""; mysql_connect("localhost", $username, $password); @mysql_select_db($database) or die("Unable to select database"); if (isset($_POST['signup'])) { $email = htmlentities($_POST['email']); $password = htmlentities($_POST['user_pass']); $confirm_pass = htmlentities($_POST['user_pass_confirm']); $first_name = htmlentities($_POST['first_name']); $last_name = htmlentities($_POST['last_name']); $avatar = htmlentities($_POST['avatar']); if ($password != $confirm_pass) { $response = "password does not match the confimed password"; } else { $response = "password is good"; session_start(); $_SESSION['user'] = signUp($email, $password, $first_name, $last_name, $avatar); header('location: test.php'); } } else { $response = "never entered"; } ?> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content="">
<?php include "settings.php"; include "inc/login_functions.php"; include 'sites/SignUp/functions.php'; $logedIn = access($mysqli, false); // Falls eingelogt dann darf Weiterleitung zu Account und nicht nochmal registrieren if ($logedIn === true) { header("Location: " . PROJECT_HTTP_ROOT . "/sites/Account/account.php"); exit; } $test = signUp($mysqli); // direkt zum Account if ($test === 1) { header("Location: " . PROJECT_HTTP_ROOT . "/sites/UpdateUserData/updateUserData.php?code=1"); exit; } if ($test === 2) { header("Location: 404.php"); exit; } // AB Test switch (rand(0, 1)) { case 0: $update = $mysqli->query("UPDATE indexviews SET views = views + 1 WHERE id = '1' "); $index = 1; break; case 1: $update = $mysqli->query("UPDATE indexviews SET views = views + 1 WHERE id = '2' "); $index = 2; break;
$password = ""; $dbname = "eBay"; session_start(); if (isset($_POST['action'])) { switch ($_POST['action']) { case 'login': logIn($_POST['eMail'], $_POST['password']); break; case 'addtoCart': addToCart($_POST['id'], $_POST['quantity']); break; case 'buy': buy($_POST['id'], $_POST['quantity']); break; case 'signup': signUp($_POST['eMail'], $_POST['password'], $_POST['firstname'], $_POST['lastname']); break; case 'upload_image': uploadImage(); break; case 'add_to_cart': addToCart(); break; case 'load_products': loadProducts(); break; case 'load_cart_products': loadCartProducts(); break; case 'load_history_products': loadHistoryProducts();
<?php include 'DBO.php'; $connection = connectToDatabase(); $email = $_GET["email"]; // $_POST $pass = $_GET["password"]; $fName = $_GET["fname"]; $lName = $_GET["lname"]; $return = signUp($connection, $email, $fName, $lName, $pass); // if(!$return){ // sendErrorJSON("Error"); // } session_start(); $_SESSION["UNO"] = $return['UNO']; echo json_encode($return);
// // }).done(function(response) { // // // }).fail(function() { // // }); $action = $_GET['action']; if ($action == 'login') { login($_GET['email'], $_GET['password']); } if ($action == 'logout') { logout(); } if ($action == 'sign_up') { signUp($_GET['first-name'], $_GET['last-name'], $_GET['phone-num'], $_GET['email'], $_GET['password']); } if ($action == 'search_flights') { searchFlights($_GET['flight_from'], $_GET['flight_to'], $_GET['date']); } if ($action == 'select_flight') { selectFlight($_GET['flight_id']); } if ($action == 'display_user_bookings') { displayUserBookings(); } // // if($action == 'check_session'){ // checkSession(); // } //
//Database Connectivity include_once "dbinfo.inc.oop.php"; // Retrieving input values $type = $_POST['type']; $f_name = $_POST['f_name']; $l_name = $_POST['l_name']; $c_name = $_POST['c_name']; $email = $_POST['email']; $password = $_POST['password']; $address = $_POST['address']; $phone = $_POST['phone']; $url = $_POST['url']; $tc = $_POST['tc']; $newsletter = $_POST['newsletter']; //echo $type." - ".$f_name." - ".$l_name." - ".$c_name." - ".$email." - ".$password." - ".$address." - ".$phone." - ".$url." - ".$tc." - ".$newsletter; $result = signUp($type, $f_name, $l_name, $c_name, $email, $password, $address, $phone, $url, $newsletter); if ($result) { $_SESSION['umail'] = $email; $user_details = getUserDetailsByEmail($email); $user = mysqli_fetch_array($user_details); ?> <div class="alert alert-success" id="login-success"> <strong>Well Done!</strong> You are signed up successfully! <br><br> <p> <strong>User ID:</strong> <span id="User_id"><?php echo $user['user_id']; ?> </span> <br> <strong>Name:</strong>
<?php include "../universal/config.php"; //---sendValidation---// if (isset($_POST["sendValidation"])) { include "sendValidation.php"; $result = sendValidation($_POST["email"]); echo $result; } elseif (isset($_POST["signUp"])) { include "signUp.php"; $result = signUp($_POST["key"], $_POST["email"], $_POST["username"], $_POST["password"]); echo $result; } elseif (isset($_POST["signIn"])) { include "signIn.php"; $result = signIn($_POST["email"], $_POST["password"], $_POST["remember"]); echo $result; } elseif (isset($_POST["resetValidation"])) { include "resetValidation.php"; $result = resetValidation($_POST["email"]); echo $result; } elseif (isset($_POST["resetPassword"])) { include "resetPassword.php"; $result = resetPassword($_POST["key"], $_POST["email"], $_POST["password"]); echo $result; } elseif (isset($_POST["signOut"])) { include "signOut.php"; $result = signOut(); echo $result; }
error_reporting(E_ALL); session_start(); require_once "lib_display.php"; require_once "lib_DB.php"; require_once "lib_sign_up.php"; // セッションに会員情報が保存されているか確認します $strings = array("email", "password", "last_name", "first_name", "last_kana", "first_kana", "gender_id", "birthday", "prefecture_code"); // 保存されていない項目があれば登録フォームに移動します foreach ($strings as $string) { if (empty($_SESSION[$string])) { header("location: register.php"); exit; } } // 会員登録します $member_data = array(); foreach ($strings as $string) { $member_data[$string] = $_SESSION[$string]; } $member_data["password"] = hash("sha512", $member_data["password"]); $member_data["created_at"] = date("Y-m-d H:i:s"); $member_data["updated_at"] = date("Y-m-d H:i:s"); $result = signUp($member_data); // 会員登録に失敗したら登録フォームに移動します if ($result == false) { header("location: register.php"); exit; } // register_finish.phpに移動します header("location: register_finish.php"); exit;
<meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="../../assets/ico/favicon.ico"> <title>Sign Up</title> <!-- Bootstrap core CSS --> <link href="bootstrap-3.1.1-dist/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="bootstrap-3.1.1-dist/css/signin.css" rel="stylesheet"> </head> <body> <div class="container"> <form class="form-signin" role="form" method ="post" action = "signUpPage.php" method> <h2 class="form-signin-heading">Sign Up</h2> <input type="username" name="username" class="form-control" placeholder="Username" required autofocus> <input type="email" name="email" class="form-control" placeholder="Email address" required> <input type="password" name="password" class="form-control" placeholder="Password" required> <p><button type="submit" name="submit" class="btn btn-lg btn-primary btn-block">Sign up</button><p> </form> </div> <!-- /container --> <?php signUp($dbh); ?> </body> </html>