I dunno, maybe you are not passing all of the variables to the script, for example buttlogin is not in the query also email is not passed along with buttforget. The get_input in start_page is configured to extract "post" variables, maybe you could try to change it to "both" everywhere because you call the script via "get" for example $buttlogin = get_input("buttlogin","post"); to $buttlogin = get_input("buttlogin","both");