Hey guys, I am having a problem with a simple login Javascript page that I made, which works fine and loads its "success page" (which is the page that it goes to when the login entered is correct) perfectly on my computer. However, when I upload it, the script runs fine up to the point where the login is checked for validity (it even displays an error dialog when your login is incorrect and you press login, so the button is working somewhat), but it DOES NOT go to the success page it is supposed to. It just stops. I checked the script and could not a find a "break" in the operation that could be causing it (again, it works fine on my computer). What do you guys think could be the problem? My domain host (just in case it might be the cause of the problem) is GeoCities (yes, I'm a broke student, lol).
A little about the overall website: I have made a website for my school project (which is starting a new business). The website is www.txtmobility.2ya.com if you guys want to test the hosted login page out for yourselves. Just go under the login menu and select one of the pages. They are all using the same scripts as the BusinessLogin script that is shown below.
Javascript cannot be used to create a login function. Anything that you do in the browser can be viewed by the visitor and is not secure. For example, you did not really need to post the code for BusinessLogin.js because anyone can get it from the web site itself. They can see the URL of the successful login page and enter that directly without ever bothering to enter any username or password. All the usernames and passwords are also visible in the code and any visitor would know all the usernames and passwords for everyone that you have set the site up for. If someone used the same username and password on your site that they use elsewhere, someone now knows what all those values are. Maintaining the list of usernames and passwords also requires changing the actual .js file every time you add, modify, or remove a value.
A secure login function can only really be done on the server, where the usernames and passwords are stored out of the hands of a visitor.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
The disclaimer that the author of that login script includes in the source probably should have been included in your post above -
Quote:
DISCLAIMER: Use this script with caution. This script is not
the most secure method available, for protecting material. Its
main purpose is to demonstrate the javascript techniques used.
The author takes no responsibility for data loss
resulting from the use of this script.
Only the wording should have been -
"DISCLAIMER: Do not use this script. This script is not secure.
It does not protect anything. Its
main purpose is to demonstrate the javascript techniques used.
The author takes no responsibility for data loss
resulting from the use of this script."
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
I am FULLY AWARE of the insecurity of this script. I am not a newbie extreme, lol. This is just for demo purposes only and I need the login to work, so can you guys please help and try to find out why it is not working? I personally would not use anything other than PHP (screw IIS) for my REAL company login pages, but right now, I am just a student and can barely afford a good meal (much less an expensive SQL server).
Please help me out, guys. Thanks a lot in advance!
As I'm sure you understand, I agree with Mab about using a script like this, even for a demo page. (Is't security a part of what you wish to demo? )
I couldn't test the login on the demopage (nothing happend when I clicked the login links, found no relevant error except for an XML syntax error and something which might be GeoCities ad-related).
If something works locally, but now when put on a server (and it's not using lots of AJAX or similar) it might be because GeoCities inserts ad-related code here and there, breaking the syntax and disturbing scripts. I've not had time to go through the code line by line, but it would help if you mentioned which error you got, and where.
There are free hosts, with no-ads, that offer php/mysql, just search.
When you tested this locally, were you going through a web server installed on your development computer or were you browsing directly to the file(s) through the file system?
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???