kishore
kishore

Reputation: 1017

PHP:How can I send the Data entered by a user in a text field to a txt file?

In PHP How can I send the Data entered by a user in a text field to a txt file inside of a folder on my server.

Upvotes: 0

Views: 72

Answers (1)

Delan Azabani
Delan Azabani

Reputation: 81442

To clear the file and open for writing:

$h = fopen("path and filename", "wb+");

or appending:

$h = fopen("path and filename", "ab+");

To write to the file:

fwrite($h, $myString);

Then close it:

fclose($h);

Upvotes: 2

Related Questions