Show DevBest [PHP] Login & Logout

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
You've released a PHP script with database implementation, but not posted the SQL code to create the database (not that it'd be very hard to reconstruct manually just by looking at the code.)
 

7r1n17y

New Member
Jun 11, 2017
13
5
I would not use this for production use due to the fact that their is no Csrf validation and their is a Timing attack vulnerability. Plus their is no prepared statements going on so your script is vulnerable to SQL Injection. strip_tags, stripslashes, mysqli_real_escape_string is not enough. Md5 should not be used according to the php manual . I am hoping you secured your php sessions.

PHP Manual -
 

mkelzeer

New Member
Aug 21, 2017
5
0
Nice but I actually prefer using PDO Connections because it takes less lines of codes and with can easily prevent SQL Injection. Also it is described on Codecourse YouTube Channel.
 

iCranavvo

nope! not really!
Oct 27, 2011
33
14
Nice but I actually prefer using PDO Connections because it takes less lines of codes and with can easily prevent SQL Injection. Also it is described on Codecourse YouTube Channel.

A preference that isn't shared by other developers.
PDO does not 'take less lines of code' as you put it. In fact you would have to do more; there's nothing wrong with the MySQLi class.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
A preference that isn't shared by other developers.
PDO does not 'take less lines of code' as you put it. In fact you would have to do more; there's nothing wrong with the MySQLi class.
Object-Oriented MySQLi and PDO are both an equal amount of lines, PDO might even be one shorter. Most developers will use PDO, as it has way more options than MySQLi, which only supports the MySQL driver, as where PDO supports 12 databses. MySQLi does not support named parameters, which PDO does, as they contribute to code readability.

Besides that, PDO is mainly the industry standard. MySQLi is just an easy drop-in to replace MySQL. Personally, I think MySQLi will be deprecated eventually too.
 

iCranavvo

nope! not really!
Oct 27, 2011
33
14
Object-Oriented MySQLi and PDO are both an equal amount of lines, PDO might even be one shorter. Most developers will use PDO, as it has way more options than MySQLi, which only supports the MySQL driver, as where PDO supports 12 databses. MySQLi does not support named parameters, which PDO does, as they contribute to code readability.

Besides that, PDO is mainly the industry standard. MySQLi is just an easy drop-in to replace MySQL. Personally, I think MySQLi will be deprecated eventually too.
Ah yes; thank you PDO for coming with all those unused drivers.
 

Users who are viewing this thread

Top