Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '../../cfg.php';
- include '../../ini.php';
- $postdata = file_get_contents("php://input");
- $request = json_decode($postdata);
- $email = $request->email;
- $pass = $request->password;
- $repass = $request->repass;
- $email = trim($email);
- $email = htmlspecialchars($email, ENT_QUOTES, 'UTF-8');
- $email = mysql_escape_string($email);
- $yes = intval($yes);
- if($pass != $repass) {
- $arr = array('msg' => "", 'error' => 'Passwords do not match.');
- $jsn = json_encode($arr);
- print_r($jsn);
- }elseif(!$yes){
- $arr = array('msg' => "", 'error' => 'Please read and agree to the type of service.');
- $jsn = json_encode($arr);
- print_r($jsn);
- }
- options = [
- 'salt' => blowfishSalt(),
- 'cost' => 13
- ];
- $hash = password_hash($pass, PASSWORD_DEFAULT, $options);
- $sql = 'INSERT INTO users (pass, mail) VALUES ("'.$hash.'", "'.$email.'")';
- mysql_query($sql);
- if (password_verify($pass, $user_password)) {
- $arr = array('msg' => "Successfully logged in", 'error' => '');
- $jsn = json_encode($arr);
- print_r($jsn);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement