This code doesn't having anything to do with the login, its a script that uploads a file and emails you the location of the file on your site.
By site in site do you mean something like
http://yoursite.com/another_directory
Or you are using an iframe to include files onto the page you login to that is part of different sections of your site? (if this is the case its not a secure login system)