coding style fix

This commit is contained in:
Peter Kokot
2013-12-08 16:02:22 +01:00
committed by Josh Lockhart
parent b41eeca6da
commit ff25a697d4
2 changed files with 3 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ which will delete all of your users! Instead, you should sanitize the ID input u
<?php <?php
$pdo = new PDO('sqlite:users.db'); $pdo = new PDO('sqlite:users.db');
$stmt = $pdo->prepare('SELECT name FROM users WHERE id = :id'); $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(); $stmt->execute();
{% endhighlight %} {% endhighlight %}

View File

@@ -22,9 +22,9 @@ require 'password.php';
$passwordHash = password_hash('secret-password', PASSWORD_DEFAULT); $passwordHash = password_hash('secret-password', PASSWORD_DEFAULT);
if (password_verify('bad-password', $passwordHash)) { if (password_verify('bad-password', $passwordHash)) {
//Correct Password // Correct Password
} else { } else {
//Wrong password // Wrong password
} }
{% endhighlight %} {% endhighlight %}