[PHP-DB] br appear in Text file

2001-08-27 Thread Jack

Dear all
I'm writing a script which will greb the data from a user input form into a
text file (txt file), but the problem is that when the data had passed to
the txt file, there will be some thing like the br and black square appear
inside the file. This is affecting to display the data from that txt file to
the text box in (input box).
Is there anyway that i can do to avoid grebing the br from txt file to my
input box's value? or anyway that i can delete the br when the data is
greb from input box to txt file??

Thanks a lot

Jack
[EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] br appear in Text file

2001-08-27 Thread Andrey Hristov

See:
1)strip_tags
2)fgetss
3)preg_replace('|(.*?)(.*?)(/.*?)|','\2',$string);

Example:
?php
$string=a href=''alabala/a;
$string=preg_replace('|(.*?)(.*?)(/.*?)|','\2',$string);
echo htmlspecialchars($string);
?
Produces :
alabala

Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%

- Original Message - 
From: Jack [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, August 27, 2001 11:21 AM
Subject: [PHP-DB] br appear in Text file


 Dear all
 I'm writing a script which will greb the data from a user input form into a
 text file (txt file), but the problem is that when the data had passed to
 the txt file, there will be some thing like the br and black square appear
 inside the file. This is affecting to display the data from that txt file to
 the text box in (input box).
 Is there anyway that i can do to avoid grebing the br from txt file to my
 input box's value? or anyway that i can delete the br when the data is
 greb from input box to txt file??
 
 Thanks a lot
 
 Jack
 [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] br appear in Text file

2001-08-27 Thread Justin Buist

If you're getting a literal br in the file then I'd have to say you're
either typing one in the text box or have your HTML putting on in there
for you w/out knowing it.

If it's a new line or a carriage return in the file that's a different
matter.  When somebody submits data to you in a textarea or input
type=text field their newline character will match that of their OS.
For a Win32 computer this is a two character combination, a carraige
return (ASCII #13) and a line feed (ASCII #10).  For a Unix/Linux machine
it's just a line feed (ASCII #10), and for a Mac computer you get just a
carriage return (ASCII #13).

Given that I store my data on Unix/Linux machines, no matter what language
I'm using, I change all 13,10 combinations into just a 10, then all 13's
into a 10, which gives me my Unix/Linux like behavior.  If you don't want
to store any newlines then just change all 10's at that point into
nothings (or a space).

FYI, a newline (10) is often represented as \n and a carriage return (13)
as \r.

Hope that helps.


Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612

On Mon, 27 Aug 2001, Jack wrote:

 Dear all
 I'm writing a script which will greb the data from a user input form into a
 text file (txt file), but the problem is that when the data had passed to
 the txt file, there will be some thing like the br and black square appear
 inside the file. This is affecting to display the data from that txt file to
 the text box in (input box).
 Is there anyway that i can do to avoid grebing the br from txt file to my
 input box's value? or anyway that i can delete the br when the data is
 greb from input box to txt file??

 Thanks a lot

 Jack
 [EMAIL PROTECTED]




 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]