Inserting Line Break
Posted: Thu Jun 15, 2006 11:46 pm
Here's the code I'm using:
But the problem is I need to have a line break after every value that get's put in the file. Any help?
Code: Select all
<?php
$filename = 'visitors.txt';
$screenname = $_GET ['screenname'];
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $screenname) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($screenname) to file ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
?>