Quote:
Originally Posted by coolguyvarun01
But now my senior wants me to save the data Entered in user forms to be saved in a text file. any help on that???
it has to be done with the use of Javascript and/Or HTML.
|
Unfortunately, you cannot do this without a server-side language. JavaScript and HTML are client-side, meaning they have nothing to do with saving information or interacting with
your server.
Accomplishing this in PHP is very simple:
PHP Code:
$data = $_GET['username'] . $_GET['password'];
file_put_contents("users.txt", $data, FILE_APPEND | LOCK_EX);
http://www.w3schools.com/php/func_fi...t_contents.asp
You should also look into using a mySQL database, like phpmyadmin, saving information in a text file is not very efficient or safe.
I honestly can't think of many reasons why you would want to save information in a text file or not use PHP for that matter...