Commit c2e2cf42 authored by Tanmim Hanifa's avatar Tanmim Hanifa
Browse files

Updated php files (temporarily using tanmim database, will migrate to jess soon)
parent e35a03c1
<?php
$con = mysqli_connect("localhost", "thani001", "password", "thani001_travelapals");
$username = $_POST["username"];
$password = $_POST["password"];
$statement = mysqli_prepare($con, "SELECT * FROM user WHERE username = ? AND password = ?");
mysqli_stmt_bind_param($statement, "ss", $username, $password);
mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement, $userID, $email, $name, $dob, $password, $username);
$response = array();
$response["success"] = false;
while(mysqli_stmt_fetch($statement)){
$response["success"] = true;
$response["email"] = $email;
$response["name"] = $name;
$response["dob"] = $dob;
$response["username"] = $username;
$response["password"] = $password;
}
echo json_encode($response);
;?>
\ No newline at end of file
<?php
$con = mysqli_connect("localhost", "thani001", "password", "thani001_travelapals");
$email = $_POST["email"];
$name = $_POST["name"];
$dob = $_POST["dob"];
$password = $_POST["password"];
$username = $_POST["username"];
$statement = mysqli_prepare($con, "INSERT INTO user (email, name, dob, password, username) VALUES (?, ?, ?, ?, ?)");
mysqli_stmt_bind_param($statement, "sssss", $email, $name, $dob, $password, $username);
mysqli_stmt_execute($statement);
$response = array();
$response["success"] = true;
echo json_encode($response);
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment