« first day (1351 days earlier)      last day (3603 days later) » 
05:00 - 21:0021:00 - 22:00

Kal
9:00 PM
<?php

$user = "joe";
$pass = "mypass";

$stmt = array(array("username"=>"joe", "password"=>"mypass"));
foreach ($stmt as $row) {echo $user . " " . $row['username'] . " " . $pass . " " . $row['password'] . "<br/>"; if($user == $row['username'] && $pass == $row['password']) {echo "YES YES YES <br/>";} else {echo "WO WO WO <br/>";}}


$user = "joexxxxxxxxxxx";
$pass = "mypass";

$stmt = array(array("username"=>"joe", "password"=>"mypass"));
foreach ($stmt as $row) {echo $user . " " . $row['username'] . " " . $pass . " " . $row['password'] . "<br/>"; if($user == $row['username'] && $pass == $r
output is:
joe joe mypass mypass
YES YES YES
joexxxxxxxxxxx joe mypass mypass
WO WO WO
 
emmm ... why are there plain-text passwords in a database ?
 
@tereško so they can be recovered more easily
 
=P
 
@Kal Thanks but this is my code so far: gyazo.com/fff05a3d098a1d9320467e62f6668a98
@Kal You see, im comparing to DB, for a login script.
 
Kal
of course it's going to be salted password
;)
 
9:09 PM
@Kal I'm not sure I ever was so naive
 
Kal
i hope that helps
 
Im trying to do $pass = password_hash($_POST['password'], PASSWORD_DEFAULT); but then I get no echo. Should my table also have a hashed pass insterted in it?
 
Kal
you need to sanitize your $_POST before you check your db
 
How so?
 
Kal
that's a different topic
fast answer for string mysql_real_escape_string('xxx');
 
9:12 PM
People told me not to use mysql_*.
Also my db is using PDO
 
Kal
of course
i'm just saying
 
So do I need to do something to $_POST?
 
Kal
pdo you could use PDO::quote()
in your code try this $stmt->execute([ 'username' => $userDB, 'password' => $passDB ]);
 
@Kal bullshit
 
Kal
tre
true
i take that back
 
9:20 PM
@RahulKhosla are you aware that you are not fetching the data ?
 
@tereško Im not??
@tereško I am arn't I? The script works.. I type user:rahul and pass:abc23
and I get "Yes".
 
9:40 PM
Can't make my mind up if I should use type casting or throw exceptions if the wrong type was provided, ex: github.com/PatrickLouys/http/blob/master/src/HttpCookie.php
 
05:00 - 21:0021:00 - 22:00

« first day (1351 days earlier)      last day (3603 days later) »