Page 1 of 1

Create file

Posted: Mon May 16, 2005 4:17 am
by S_henry
In my system, i provide 3 textboxes (txtA, txtB, txtC). Ley say i key in TestA, TestB, and TestC in those textboxes respectively. After i click submit button, i want the system to create files (TestA.html, TestB.html, TestC.html) and save those file in a folder. The files name is based on what user input in those textbox. Anybody know how to do that. Please ask me if my explanation is not clear enough.

Posted: Mon May 16, 2005 4:40 am
by anjanesh
fopen()

Code: Select all

$handle = fopen($_POST['txtA'].".txt", "w");
fwrite($handle, $somecontent);