mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-12 08:43:58 +02:00
coding style fix
This commit is contained in:
committed by
Josh Lockhart
parent
b41eeca6da
commit
ff25a697d4
@@ -45,7 +45,7 @@ which will delete all of your users! Instead, you should sanitize the ID input u
|
||||
<?php
|
||||
$pdo = new PDO('sqlite:users.db');
|
||||
$stmt = $pdo->prepare('SELECT name FROM users WHERE id = :id');
|
||||
$stmt->bindParam(':id', $_GET['id'], PDO::PARAM_INT); //<-- Automatically sanitized by PDO
|
||||
$stmt->bindParam(':id', $_GET['id'], PDO::PARAM_INT); // <-- Automatically sanitized by PDO
|
||||
$stmt->execute();
|
||||
{% endhighlight %}
|
||||
|
||||
|
@@ -22,9 +22,9 @@ require 'password.php';
|
||||
$passwordHash = password_hash('secret-password', PASSWORD_DEFAULT);
|
||||
|
||||
if (password_verify('bad-password', $passwordHash)) {
|
||||
//Correct Password
|
||||
// Correct Password
|
||||
} else {
|
||||
//Wrong password
|
||||
// Wrong password
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
|
Reference in New Issue
Block a user