Commit 65008125 authored by Tanmim's avatar Tanmim
Browse files

adding php files for project

parent d51643f7
<?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, $name, $age, $username, $password);
$response = array();
$response["success"] = false;
while(mysqli_stmt_fetch($statement)){
$response["success"] = true;
$response["name"] = $name;
$response["age"] = $age;
$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");
$name = $_POST["name"];
$age = $_POST["age"];
$user = $_POST["user"];
$username = $_POST["username"];
$password = $_POST["password"];
$statement = mysqli_prepare($con, "INSERT INTO user (name, user, age, password, username) VALUES (?, ?, ?, ?)");
mysqli_stmt_bind_param($statement, "siss", $name, $user, $age, $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