[web] JavaScript help
I am tring to access a file for reading and writeing and i am a newbe on this language all i kno is graphs and alerts i am not tring to put file on user com i want it on my webpage. it is for my user accounts.
dose anyone have infomation for me?
Firstly, if this is for web pages, you should be posting in the web development forum. Thus, I will move this post.
Secondly... please describe in more detail what you are trying to achieve. What sort of file are you hoping to access, and why? Remember javascript runs on the client, not the server. If you allowed a browser to edit a file on any web server the entire web would probably have been destroyed long ago. Therefore you would usually have to access a certain page on your server which is written in a server-side language, which then performs the edits for you. javascript is probably not the correct tool for the job.
Secondly... please describe in more detail what you are trying to achieve. What sort of file are you hoping to access, and why? Remember javascript runs on the client, not the server. If you allowed a browser to edit a file on any web server the entire web would probably have been destroyed long ago. Therefore you would usually have to access a certain page on your server which is written in a server-side language, which then performs the edits for you. javascript is probably not the correct tool for the job.
If this is about uploading files to the server for display on a page, you don't need javascript. Check <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=422481">this thread</a>.
i am tring to read text files with username and passwords for a login page, i wont only invited people in some parts of my page.
the text is on the same page as the html
the text is on the same page as the html
Using client-side script for authentication is a mistake, as the user can trivially bypass it (in most cases).
If you have a file containing usernames and passwords that javascript can read, so can the end-user.
Even if you encrypt the passwords using a one-way function, the user can still do dictionary attacks and/or bypass it.
Mark
If you have a file containing usernames and passwords that javascript can read, so can the end-user.
Even if you encrypt the passwords using a one-way function, the user can still do dictionary attacks and/or bypass it.
Mark
Use either Apache's htaccess system (or whatever the IIS equivalent) or look into a server side scripting system (PHP, ASP.net, Ruby).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement