LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-08-2007, 08:09 AM   #1
Instantly
Member
 
Registered: Dec 2004
Posts: 78

Rep: Reputation: 15
PHP: Skipping Lines


Whats wrong with this code
Code:
<html>
<body>
<?php
$file = fopen("test.txt","a");
echo fwrite($file,$_POST["name"] . "<br />");
echo fwrite($file,$_POST["age"] . "<br />");
fclose($file);

?>
</body>
</html>
its not skipping a line....
its like nameagenameage
 
Old 07-08-2007, 09:16 AM   #2
dnorseman
Member
 
Registered: Aug 2003
Location: Chicago, USA
Distribution: RHEL, CentOS, Ubuntu
Posts: 43

Rep: Reputation: 15
Sorry I misread the post.

You need to add a \n behind the <br> and do you need the <br> in the text file?

echo fwrite($file,$_POST["name"] . "\n");
echo fwrite($file,$_POST["age"] . "\n");

now test.txt will have:
name
age

Last edited by dnorseman; 07-08-2007 at 09:35 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Irssi "skipping" and mixing lines Scorper Linux - Desktop 0 12-24-2006 06:32 AM
Asterisk box to connect VoIP lines with normal telephone lines. sraju Linux - Software 1 11-08-2006 12:38 AM
PHP Pull File Lines Into Table windisch Programming 7 11-02-2006 05:06 PM
PHP - Help With Reading Lines In A File windisch Programming 6 05-03-2006 12:48 PM
FC2 test 3 mouse skipping a beat, movie skipping also jang Fedora 1 10-28-2004 07:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration