Create file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Create file

Post 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.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

fopen()

Code: Select all

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