Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a file in php

Status
Not open for further replies.

martinb7

Programmer
Joined
Jan 5, 2003
Messages
235
Location
GB
hi, i was wondering if you could create a file using php.

say i have a form: pagename, pageinfo, filename and a submit button, how would i on another page, make it create a file with the info from the form in?

e.g.

pagename = test
pageinfo = pageinfo goes here
filename = test.php

when a user submits that form, how would you in php be able to create a file??

Thanx


Martin

Computing help and info:

 
Martin,

Try this script for inspiration ....

Code:
<?
  $pageinfo = $_REQUEST[&quot;pageinfo&quot;];
  $filename = $_REQUEST[&quot;filename&quot;];

  $myFile = fopen($filename, &quot;w&quot;);
  fputs($myFile,$pageinfo);
  fclose($myFile);
?>

Good Luck §;O)


Jakob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top