Changing a table's field
Well im using SMF ( Simple Machine Forums) to change a specific field. I use a different page so they can change it, and it would automatically change that field in the database, but it won't work for some reason. Here is what I got so far (thanks to stewie :D)
PHP Code:
If anyone could help. Edit: We also tried with md5, but it doesn't seem to work |
Re: Changing a table's field
You would need to dig around in the SMF code to see what method they use to encrypt the password and how.
|
Re: Changing a table's field
Quote:
If this is really all your code, then it won't work because $szUser is not defined. PHP Code:
PHP Code:
|
Re: Changing a table's field
Thanks I will try that out.
Its when a user tries to apply his/her steamid using a specific url, it won't work As in, it won't replace the current STEAMID that is in there |
Re: Changing a table's field
I understand that it won't update the SteamID, but with your script there are several possible reasons why:
- the username was missing - the password was missing - the username and password don't match For the above reasons the script won't return an error or notice. To make it do so, you could use this: PHP Code:
|
Re: Changing a table's field
PHP Code:
Also nothing is displayed, like the submit, nor the username or password |
Re: Changing a table's field
Whoops.
Replace line 17 with PHP Code:
PHP Code:
|
Re: Changing a table's field
PHP Code:
Edit: PHP Code:
|
Re: Changing a table's field
I used mysql_real_escape_string before a connection to MySQL was made, which explains the warning and the empty username. I've updated the post once more.
By the way, you still haven't revealed your version of SMF. |
Re: Changing a table's field
Ahh Sorry about that.
2.0.0 RC3 PHP Code:
|
Re: Changing a table's field
Argh. Remove the ) on line 28.
|
Re: Changing a table's field
PHP Code:
|
Re: Changing a table's field
I take it you replaced the hashed password with 'hidden' in the query? There's no need to do that, because it's not reversible. Anyway, after glancing at LoginOut.php of SMF 2.0.3 RC, the used hashing method of the password looks correct.
|
Re: Changing a table's field
Yeah I replaced it. Didn't know it was not able to be reversible.
Either way it's not working. I have no clue why and the error_logs don't have anything. |
Re: Changing a table's field
There are no errors logged since there are no errors. The script 'works', but it doesn't what you need it to do. The only thing we can conclude safely is that user 'levin' does not have the password that was provided after hashing it. It's probably best to continue your quest on the SMF forums, as there will be more people knowledgeable about how SMF works (I clearly have no idea).
Another thing you could consider, depending on your goal, is to add your code as a plugin. This way you won't have to check user credentials the hard way and can leave it up to SMF itself. It will then also not break after an update in which they've changed the hashing. |
Re: Changing a table's field
Alright, Thank you for your help :D
|
Re: Changing a table's field
No problem. Good luck :)
|
| All times are GMT -4. The time now is 00:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.