Jump to content


Mr-Chidi

Member Since 20 May 2008
Offline Last Active Yesterday, 02:09 AM

Posts I've Made

In Topic: Why is this not loggin me in

26 October 2014 - 05:34 AM


It's a bad idea, one of the 3 mentioned above.
That would not make it more secure and increase the chance of a collision.


Is pdo even enabled on that server?
ensure the extension is uncommented in the php.ini file

extension=php_pdo_mysql.dll
Enable error reporting as mac_gyver suggested.
Top of your script.
error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors', '1');
You can wrap the pdo in a try/catch block and see any errors[cuode=auto:0]
try {
$stmt = $pdo->prepare("SELECT * FROM confirm WHERE username=:username AND password=:password");
$stmt->bindValue(':username', $username, PDO::PARAM_STR);
$stmt->bindValue(':password', $pass, PDO::PARAM_STR);
$stmt->execute();
}
catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}[/code]

yes I think pdo is enabled cos I could log in at the admin end and It's using pdo

In Topic: Why is this not loggin me in

26 October 2014 - 02:51 AM

your code has no apparent error checking logic in it and any of the pdo statements could be failing due to errors. after you make the pdo connection, you should set the error mode to exception and you should set emulated prepares to off/false. you should also have php's error_reporting set to E_ALL and display_errors set to ON when debugging any code problems to get php to help you.

you also need to use the same password hashing method in the login code that was used when the user's account was created. what exactly is your user registration password hashing code?


thanks for yours above. the password hashing is same both on logging.
I said I could login on my localhost but cant when live.

In Topic: Why is this not loggin me in

25 October 2014 - 07:55 AM

did you forget session_start(); ?


Nope. jus t didn't include it here

In Topic: Why is this not loggin me in

25 October 2014 - 07:53 AM

Oh I forgot to mention that even with path as is, it's logging into the intended area with mysql but when modified to pdo, it doesn't log in

In Topic: Why is this not loggin me in

25 October 2014 - 06:48 AM

Thanks all. I'm in transit. will try them out. I think the problem should be the path. and my password will change to sha1 or maybe after md5 then I sha1 again or what do u think?

my admin uses a different login totally from the users.

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com