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
textarea - no line breaks
Old 04-20-2005, 06:11 PM textarea - no line breaks
Novice Talker

Posts: 9
Trades: 0
Greetings,

A relative newbie so any suggestions welcome.

Information sent to flatfile database - one field via a textarea.
A later option is to change the data in that (textarea) field. I have a login routine which loads the relevant data - BUT - the textarea only writes the first line (of multiline entry).

I have tried fiddling the line endings
str_replace
preg_
nl2br - and a few other variations.

The problem seems that the line ending (or breaks, or carriage returns?) are just not being written to the database in the first place.

I have set up a simple file set at:
http://www.buddhamind.info/temp/log/page.php
There are no index files in the folder so scripts are viewable.

I am not sure where the error might lay so hesitate to post too much script in the forum. Here at least is the write file:

@extract($_POST);
$fp = fopen("db/do_data.txt","a");
$content = "$fname\t$lname\t$your_x\t$seek_x\t$ages\t$country \t$Email\t$user\t$pass\t$code\t$bD\t$bM\t$bY\t$sta r\t$file\t$hobbies\n";
fwrite($fp,"$content");
fclose($fp);
echo "<HTML><META HTTP-EQUIV='REFRESH' CONTENT='0; URL=page.php'>";

Hours of my life have been (mostly happily) hacking this dilemna. Enough!
Help is my only salvation (that's you?)

thanks - arfa
arfa is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-20-2005, 07:27 PM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
could i ask why you're using flatfiles and not mySQL? SQL will be a much better option, as PHP has function written in to be able to handle SQL much better than flat files
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 04-20-2005, 09:47 PM using flatfile
Novice Talker

Posts: 9
Trades: 0
hi,

using flatfile as I am still getting my head around the whole PHP 'thing'.
SQL seems another step on.

Also I have arrived via cgi and free scripts and various other historical contexts.

and the textarea
arfa is offline
Reply With Quote
View Public Profile
 
Old 04-21-2005, 06:10 AM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
Ok, that's fair enough. By CGI im assuming Perl? I used to use that, god it was awful!

It's probably only putting the first line of the textarea in, because it actually is a flatfile, which means records have to stay on one line, and thus you'd have to format the text before it is placed into the file (Stripping line breaks, spaces, etc).

I would encourage you use SQL, SQL is very easy, and PHP is pretty much built around it so the functionality is top notch. I recommend you read this tutorial it should get you started with no problems at all.

SQL will allow you to put huge chunks of unformatted code, without having to change line breaks or spaces.
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 04-21-2005, 01:37 PM
Novice Talker

Posts: 9
Trades: 0
Yes, SQL seems a logical next step but....
In the meantime - why does it not work?
I have the database textarea working with multilines with the cgi (yes, perl - yes, awful) script.

I can even use that database to get textarea multiline display using the PHP script I have built.
BUT!!! change the database (using text editor) and
1) the file size increases - even just for one character addition
2) textarea display cuts back to one line

weird - why?
arfa is offline
Reply With Quote
View Public Profile
 
Old 04-21-2005, 01:39 PM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
Sorry i can't actually give an explanation, i never really used flatfiles, even with Perl, so i don't know any troubleshooting solutions with them
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to textarea - no line breaks
 

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.21258 seconds with 12 queries