Verify Password Matches Post to Game

Post Reply
User avatar
evenmonkeys
Posts: 78
Joined: Thu Feb 13, 2014 1:53 am
Location: Midwest, US

Verify Password Matches Post to Game

Post by evenmonkeys » Tue Nov 04, 2014 11:42 pm

I don't even know if this is possible as I've been playing around with this for a couple of weeks.. but I can't get it working.

All I want to do is verify if the player's POSTed "password" matches the password in their game account.

It appears that passwords are entered into the game database using:

Code: Select all

accounts (password)
VALUES (PASSWORD('%s'))
Whatever %s means.. I can't figure that out. Anyways!

What do I need to do to verify that password? The following does not work:

Code: Select all

SELECT * FROM `accounts` WHERE id='$id' && password = PASSWORD($_POST[password])
How do I verify these passwords? -_-

Edit: Figured it out. =\ Spelling error. I've seriously been dealing with this for like 10 days. Gahhhhhh.
Last edited by evenmonkeys on Wed Nov 05, 2014 1:13 am, edited 1 time in total.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Verify Password Matches Post to Game

Post by kjLotus » Wed Nov 05, 2014 12:36 am

works fine for me

make sure your syntax is correct and that your string is being built correctly

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Verify Password Matches Post to Game

Post by whasf » Wed Nov 05, 2014 11:33 am

Make sure you sanitize user input so people can't do injection attacks! Also, don't pass the id and password on the URL :)
-- Whasf

Post Reply