Created
April 29, 2020 09:19
-
-
Save prensmiskin/e9ee5902c3545be7e4ff586cd821037a to your computer and use it in GitHub Desktop.
Sahnarts App / LOgin işlemi başladığında çalışan web servis kodları. Şuan bu kodlar sunucuda çalışmaktadır.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($_SERVER['REQUEST_METHOD']=='POST'){ | |
$mailx = $_POST["mailx"]; | |
$passwordx = $_POST["passwordx"]; | |
$servername = "delete"; | |
$username = "delete"; | |
$password = "delete"; | |
$dbname = "delete"; | |
try { | |
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); | |
// set the PDO error mode to exception | |
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
// başlangıç | |
$v = $conn->prepare("select * from register where mail=? and password=?"); | |
$v->execute(array($mailx, $passwordx)); | |
$x = $v->fetch(PDO::FETCH_ASSOC); | |
$d = $v->rowCount(); | |
if($d){ | |
$result["success"] = "1"; | |
$result["message"] = "success"; | |
echo json_encode($result); | |
}else{ | |
} | |
// $result = mysqli_query($conn,$sql); | |
// $row = mysqli_fetch_array($result,MYSQLI_ASSOC); | |
// $active = $row['active']; | |
//$count = mysqli_num_rows($result); | |
// If result matched $myusername and $mypassword, table row must be 1 row | |
// if($count == 1) { | |
//session_register("firstname"); | |
// $_SESSION['login_user'] = $name; | |
// echo "tamam"; | |
//header("location: welcome.php"); | |
//}else { | |
//echo "hayır"; | |
$error = "Your Login Name or Password is invalid"; | |
// } | |
// bitiş | |
} | |
catch(PDOException $e) | |
{ | |
echo $sql . "<br>" . $e->getMessage(); | |
} | |
$conn = null; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment