Sign in to follow this  
Thoover

[web] JavaScript help

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Use either Apache's htaccess system (or whatever the IIS equivalent) or look into a server side scripting system (PHP, ASP.net, Ruby).

Share this post


Link to post
Share on other sites
one more question:

Is it possible to use a program written in c to access a file on a web page or only in java? if this is possible i would like links, i googled and couldn't find anything on it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this