Gosh! JC, I used $_POST['textbox'] as an example for you. If you wish to end 
your lines by "\r\n" instead of "\n" just do it, like here

$file_data = "editdate#".date('l d_m_Y')."\r\n";

And if you have some textareas on your HTML form, you can change them like

$_POST['textbox'] = str_replace("\n", "\r\n", $_POST['textbox']);

Where 'textbox' is a name of your textarea field. Got it?

Sincerely,
Rosty Kerei <[EMAIL PROTECTED]>


"JC Botha" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
I greatly appreciate your help! Thank you so much.

 if ($_POST[update] == "update") {

 //write info to file

$file_data = "editdate#".date('l d_m_Y')."\n";

$file_data .= "createdate#$_POST[createdate]\n";

$file_data .= "title#$_POST[title]\n";

$file_data .= "description#$_POST[description]\n";

$file_data .= "sender#$_POST[sender]\n";

$file_data .= "letter#$_POST[letter]\n";

$file_data .= "response#$_POST[response]\n";

addslashes($file_data);

$file_data = str_replace("\n", "\r\n", $file_data);

$id = $_GET['id'];

$file_location = "letters/$id";

 if (is_writable($file_location))

{

if (!$handle = fopen($file_location, 'w'))

{

echo "Cannot open file ($file_location)";

exit;

}

$_POST['textbox'] = str_replace("\n", "\r\n", $_POST['textbox']);

if (fwrite($handle, $file_data) === FALSE)

{

echo "Cannot write to file ($file_location)";

exit;

}

fclose($handle);

} else {

echo "The file $file_location is not writable";

}

}

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

Reply via email to