How to make authorization and registration of a PDO?

All good!
Please tell me how to do registration and authentication of PDO?
Valid registration from the database?
June 10th 19 at 14:53
1 answer
June 10th 19 at 14:55
Normal check-in ever done??
Exactly the same, just a bit code is another entry in the booze. with PEREPODGOTOVKI variables.
And if you did before queries using pdo, all exactly the same.
For example, a simple request.
$stmt = $pdo->prepare('SELECT email, password FROM users WHERE email = :email AND password = :password AND account_type = :admin');
$stmt->bindParam(':email', $email);
$stmt->bindParam(':password', $password);
$stmt->bindParam(':admin', $admin);
$stmt->execute();
$row = $stmt->fetch();
- Kamron29 commented on June 10th 19 at 14:58
Thanks for the response!
But I need for the API, this method ispolnitsja using name="" - Ilene_Ward commented on June 10th 19 at 15:01
And no API name=""? - Ilene_Ward commented on June 10th 19 at 15:04
,
<input name="email">


$stmt->bindParam(':email', $_POST['email']);
$stmt->bindParam(':password', $_POST['password']);
$stmt->bindParam(':admin', $_POST['admin']);
$stmt->execute();


So, the same thing that I'm sent from above. Only there I already made the variables. $admin/$email/$password - Kamron29 commented on June 10th 19 at 15:07
Sorry can you write your email?
If you don't mind?) - Ilene_Ward commented on June 10th 19 at 15:10
, Written by himself. - Kamron29 commented on June 10th 19 at 15:13

Find more questions by tags PHP PDOPHP