Current location: Hot Scripts Forums » Programming Languages » PHP » Write form data to file


Write form data to file

Reply
  #1 (permalink)  
Old 12-27-03, 05:48 PM
dragge dragge is offline
New Member
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Write form data to file

Hi...
I would like some help with writing form data to a file.
I want the info from 2 form fields to be put in a file on my server. the name of the file will be the info from one of the 2 fields.

field 1: Name
field 2: e-mail
print to file with name from field 1
both info lines of the two fields will be put in the file:
"
Marc
marc@marc.com
"
Marc.txt

then 2 days later a new person comes along and enters
Homer
homer@homer.com

then a New file should be created on the server with the name Homer.txt ... do u guys follow me? Hope someone can helt me out!
Reply With Quote
  #2 (permalink)  
Old 12-27-03, 07:26 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

I guess you can make a writable directory and fopen() a file in this directory using "w" mode and name it as $field1.".txt". This will create a file (overwrite if it already exists) whose name is $field1 with a ".txt" extention.

Then, write two fields onto it as you like. Writing $field1."\n".$filed2 should do the job.

For syntax, and other file functions, check this out:

http://ca2.php.net/manual/en/function.fopen.php

Good luck.
__________________
Blavv =|
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
formmail problem gscraper Perl 12 08-27-04 03:06 AM
how to extract data from a form jasari Perl 1 11-07-03 12:35 AM
PHP - Dir listing and write to file NickyWhicko PHP 4 08-24-03 02:42 AM
Upload file type and size limiter! Arctic ASP 1 08-02-03 07:06 PM


All times are GMT -5. The time now is 07:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.