WOW, what a question.....Is this production, or beta?
If production, Who else is having this problem?
So, let me see, you have access to the script, but you are not certain where the script connects?
"$query = sprintf("UPDATE 'users' SET 'password' = '%s'
WHERE 'email' = '$forgotpassword'",
So, where does the USERS table reside? Either you are failing to connect, or you are failing to update the USERS table with the newly created password in the variable - $strforgotpassword.
So, I would troubleshoot by gaining access to the DB and seeing the index of USERS!
IS your DB being connected to? I notice in your code that you check for all sort of server side stuff, but not if the DB makes a valid connection. Maybe you might want to give feedback if DB is not connected to.
Also, the browser may be injecting ascii codes for characters, therfore never finding a match. Also, I would suggest not making changes based on the email, but get the user ID from the email, and change the QUERY based on the ID, and not the email. Just an idea.
Check the DB is ONline.