<?php

require '../connForms/acdet.php';

$userName = $_POST['mobName'];
$userPass = $_POST['mobPass'];
$latitudeStr= $_POST['latitude'];
$longitudeStr = $_POST['longitude'];
$locDate = $_POST['locdate'];

$mysqli = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME);

$userName = $mysqli->real_escape_string($userName);
$userPass = $mysqli->real_escape_string($userPass);

$iterations = 1000;
$salt = count($userName) * 23;
$hashPass = hash_pbkdf2("sha256", $userPass, $salt, $iterations, 25);


$sql = "UPDATE accounts SET latitude='$latitudeStr', longitude='$longitudeStr', loctime='$locDate' WHERE username='$userName' and userpass='$hashPass'";

$mysqli->query($sql);

$mysqli->close();


?>