I want my PHP script to write a file to my directory. What this would do is write a file called hello.php, hello.txt, or hello.html and put it in a specific directory.
The reason is so that when a user fills out their name and age on a form, it would generate a .html file that would be a basic outline, including theirname and age from the form data.
Take a look at
file_put_contents(). http://php.net/manual/en/function.file-put-contents.phpHowever, is there a reason you want to generate static HTML files? It is generally better to store data in a database, and then generate pages on the fly with PHP.