[release] Reset Lost Password Script

04/30/2011 23:56 ~*Kronic*~#16
Nice release :) I would add some input sanitization though, to easy to hack that script and gain full access to accounts table (no offense as all the sites on here require that).
05/01/2011 00:18 Eurion#17
Since its constantly connected through mysql, you can use mysql's built in mysql_real_escape_string(variable) function. It will sanitize any input that could harm the database.
05/01/2011 00:44 PowerChaos#18
i am not that skilled at mysql/php
i mostly copy/paste the core functions from differend scripts to mix it to a part to do what i need to do (this script is a rebuild of a register script with verification email and a few other scripts where i took the code from)

basicly i wanted to make it with a dual database conection ( single database on website and main database on vps so you can only acces the database from the vps with read acces , is safer then allowing a conection from the web to the vps) but i failt at that part as everyhting that i found doesnt seems to work :'(

anyway
it is atleast a usefull release for some persones , you are free to modifie it for your needs and improve it , but let me know when you want to re release it as it is still my own work :D

Greets From PowerChaos

if you got example codes for me , please send them to me and i will use them in the script (i just need the basic functions and examples) so i know what i can put in it
05/01/2011 01:18 Eurion#19
I've gone through and fixed up the majority of the sanitizing issues. I haven't tested it, but I don't see how it could cause any issues. These are just simple sanitizing functions, if you want to fully secure it, I suggest that you write up your own functions.

If you encounter any problems with this, feel free to post.

newpass.php:

lostpass.php:
05/01/2011 01:41 PowerChaos#20
ok , Thank you
i changed a few more things in it that i noticed (in some cases)

i changed the "echo" comamnds to "die" commands to prevent execution of the other commands (what happends in rare cases)

but after looking true the script i founded something where i can not figure out how it comes that it works ( make no sense for me but it works)

Code:
else{
					$sql = "UPDATE account SET password='$hash' WHERE name='$userid'";
					$query = mysql_query($sql) or die(mysql_error());
if i understand php good enouf , then $query need to run somewhere or it is not even suposed to be running ? (as it is a variable that get set to the command $query so you can use that command to execute on the place you like )

anyway , thank you for the update
i going edit my first post with this new post and the mirror fix on it

Greets From PowerChaos
05/01/2011 01:47 Eurion#21
Quote:
Originally Posted by PowerChaos View Post
ok , Thank you
i changed a few more things in it that i noticed (in some cases)

i changed the "echo" comamnds to "die" commands to prevent execution of the other commands (what happends in rare cases)

but after looking true the script i founded something where i can not figure out how it comes that it works ( make no sense for me but it works)

Code:
else{
					$sql = "UPDATE account SET password='$hash' WHERE name='$userid'";
					$query = mysql_query($sql) or die(mysql_error());
if i understand php good enouf , then $query need to run somewhere or it is not even suposed to be running ? (as it is a variable that get set to the command $query so you can use that command to execute on the place you like )

anyway , thank you for the update
i going edit my first post with this new post and the mirror fix on it

Greets From PowerChaos
The $query variable is what's running the sql. Since you have it defined, it will run even if its not called through an echo or print statement.