[PHP-DB] file save part 2

2003-03-08 Thread Ryan Holowaychuk
I have tried a few things and I can get the file to have each line on
its own line.
Once again this is a roster input that I adding to our website:  No,
name grade .

The roster will contain 15 players

So right now the implode puts everything on one line in the text file!!!

So I am no sure if anybody can shed some light on this one

Thanks
Ryan

?
//create a new file
 $fp = fopen(/place/on/server/ . $HTTP_POST_VARS['team'] ,
w);

 $file_data = implode(\t\, $_POST);
//this would return values spit by tabs
//write to the open file handle
 fwrite($fp, $file_data . \r\n);
//close the file
 fclose($fp); 

?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] file save part 2

2003-03-08 Thread Paul Burney
on 3/8/03 6:13 PM, Ryan Holowaychuk at [EMAIL PROTECTED] appended the
following bits to my mbox:

 I have tried a few things and I can get the file to have each line on
 its own line.

FYI, this is probably on the wrong list since it isn't database related.
You should post to PHP-GENERAL to get more responses.

What do you mean by 'line'?  Do you mean each piece of data, i.e., (no,
name, grade)?  If so, you need to implode using the the newline.

If you are accepting multiple entries to the file, change the mode from w to
a to append new data.

$file_data = implode(\r\n, $_POST);

If that doesn't help, send an example of what you want the data to look
like.

Sincerely,

Paul Burney

-- 

I'm inhaling Caesar's last gasp...
http://paul.burney.ws/thoughts/caesars_breath.html


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php