Writing To A File Using Fopen

Their will be many different instances when you might need to write to a file.  What we are going to do now is create an HTML form, and a PHP code so when you click submit on the HTML form it writes the users input to a file.

In this PHP script, we are going to be using the /n function, fopen, fput, and fclose commands.

First, we are going create an HTML page that has the following code.

OK, now that we have created the HTML form for the user to enter their input we need the information to be written to a file.  Create another page called writetofile.php

There ya have it.  Your very own script that can write to a file!  Go program! Good Luck!