Jump to content

create different text files


arnoldd99

Recommended Posts

Hi,

 

I need to create a different text file every time a user registers. Currently every time a user registers there details are sent to "users.txt". So all user details are in the same text file. I would idealy like each text file to be named after the username registered.

 

Here is the code currently being used:

 

$username = $_POST['username'];
$password = $_POST['password'];
$data = "$username, $password /n";

$fh = fopen("users.txt", "a");
fwrite=($fh,"$data");
fclose=($fh);

Link to comment
https://forums.phpfreaks.com/topic/77198-create-different-text-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.