elektroman
November 15th, 2005, 03:19 AM
Hi guys
I need to interact with a text file from Javascript code
This file resides in the server
Do you know some code to read from text files and write into them?
Thanks in advance
olivthill
November 15th, 2005, 05:41 AM
Javascript is running on the client station, and has no access to the server.
The only thing that can be done is a dialog between the client and the server, but that requires some code on the server side, and that code will not be written in javacript, but in an other language, .e.g. PHP, java, etc.
PeejAvery
November 15th, 2005, 08:51 AM
And if you do have access to use PHP on your server look into the following commands with PHP.
fopen (http://us2.php.net/manual/en/function.fopen.php)
fclose (http://us2.php.net/manual/en/function.fclose.php)
fread (http://us2.php.net/manual/en/function.fread.php)
fgets (http://us2.php.net/manual/en/function.fgets.php)
fwrite (http://us2.php.net/manual/en/function.fwrite.php)