Ok there r two text boxes, one for username and another for password, How i can save the login info to .txt file by pressing "login" button? No need for hashes or anything other thing to secure the login info then.
like this
username1|password
username2|password
Saving login info
Moderator: General Moderators
Re: Saving login info
$fp = fopen('file.txt', 'w');
fwrite($fp, $_POST['username'] . ':' . $_POST['password']);
fclose($fp);
If you're trying to do a user login though, it would be better to just use sessions. Hashing is less necessary with sessions than with cookies (althought i'd still recommend it).
fwrite($fp, $_POST['username'] . ':' . $_POST['password']);
fclose($fp);
If you're trying to do a user login though, it would be better to just use sessions. Hashing is less necessary with sessions than with cookies (althought i'd still recommend it).
Re: Saving login info
But how i use/where do i put that code? Im bit noob at phpPost subject: Re: Saving login info
$fp = fopen('file.txt', 'w');
fwrite($fp, $_POST['username'] . ':' . $_POST['password']);
fclose($fp);
If you're trying to do a user login though, it would be better to just use sessions. Hashing is less necessary with sessions than with cookies (althought i'd still recommend it).
$fp = fopen('file.txt', 'w');
fwrite($fp, $_POST['username'] . ':' . $_POST['password']);
fclose($fp);
If you're trying to do a user login though, it would be better to just use sessions. Hashing is less necessary with sessions than with cookies (althought i'd still recommend it).
Re: Saving login info
i think i figured it out. Thanks!
Re: Saving login info
WTS?samb0057 wrote: Hashing is less necessary with sessions than with cookies
Knitting is less necessary with riding a car than riding a bicycle.
That's more or less what you're saying.