Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-16-2006, 12:56 AM Inserting Line Break
Junior Talker

Posts: 1
Name: James
Trades: 0
Here's the code I'm using:
PHP Code:
<?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";
}
?>
But the problem is I need to have a line break after every screenname that get's put in the file. Any help?
perks is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-16-2006, 01:38 AM Re: Inserting Line Break
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Change the following:

PHP Code:
// Find...
$screenname $_GET ['screenname'];
 
// Change to...
$screenname $_GET['screenname'] . "\n"
This will append a newline after each entry, ready with a newline for the next time.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Inserting Line Break
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09550 seconds with 12 queries