RE: [PHP] textarea vs. type=text data difference?

2004-10-11 Thread Gryffyn, Trevor
Just wanted to point out something little.   text types are all
single-line data items.  textarea can contain line breaks.  Looks like
you may have solved your problem already, but wanted to fill in some
info that didn't seem to be mentioned.

-TG

 -Original Message-
 From: Sam Smith [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, October 10, 2004 3:29 PM
 To: PHP
 Subject: [PHP] textarea vs. type=text data difference? 
 
 
 
 I have a form with both textarea and text type fields.
 
 I submit it and do some processing on identical data and get different
 results.
 
 What's up with that.
 
 Thank you.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] textarea vs. type=text data difference?

2004-10-10 Thread Sam Smith

##The data is the same. I've been up a long time.

BUT something is still very weird.

Doc1.php (loaded in web browser)
//contents of Doc1.php
include functions.php
include formProcessor.php
include form.php

Calling the protectText() function in functions.php from
formProcessor.php with data posted from form.php works on data posted
from textarea fields but does NOT on data posted from type=text.

//contents of functions.php ONLY works on textarea fields
The fundtion in function.php is:
function protectText($tv) {
$tv = stripslashes($tv);
$tv = str_replace(\,[QT],$tv);
$tv = str_replace(\r,br,$tv);
return $tv;
}

BUT if I put the same function in formprocessor.php it works!??

//contents of formprocessor.php THIS works on both
function TSTprotectText($tv) {
$tv = stripslashes($tv);
$tv = str_replace(\,[QT],$tv);
$tv = str_replace(\r,br,$tv);
return $tv;
}

TSTprotectText($_POST['field']);

Now how can that be?


 Can you be a little more specific on what differences you get?
 
 I normally use textarea for multi-line data and input type=text for one
 line, short data... the only difference you might encounter that I can think
 off the top of my head is maybe line break?
 
 
 - Original Message -
 From: Sam Smith [EMAIL PROTECTED]
 To: PHP [EMAIL PROTECTED]
 Sent: Sunday, October 10, 2004 3:28 PM
 Subject: [PHP] textarea vs. type=text data difference?
 
 
 
 I have a form with both textarea and text type fields.
 
 I submit it and do some processing on identical data and get different
 results.
 
 What's up with that.
 
 Thank you.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] textarea vs. type=text data difference?

2004-10-10 Thread Greg Donald
On Sun, 10 Oct 2004 12:28:53 -0700, Sam Smith [EMAIL PROTECTED] wrote:
 I have a form with both textarea and text type fields.
 
 I submit it and do some processing on identical data and get different
 results.
 
 What's up with that.

No idea since you didn't post any code.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] textarea vs. type=text data difference?

2004-10-10 Thread Minuk Choi
Okay, so in other words...
//Doc1.php
include functions.php //this file contains the function definition for 
protectText()
include formProcessor.php //this file contains the code that calls 
protectText()
include form.php //this file gets the form data from user

By any chance, are ANY of the include files classes?  I'm not 100% 
sure(unless you put up some more code), but it sounds like it's maybe a 
scope error... especially if you define the function in formProcessor and it 
works fine...

-Minuk
- Original Message - 
From: Sam Smith [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Sunday, October 10, 2004 4:25 PM
Subject: Re: [PHP] textarea vs. type=text data difference?


##The data is the same. I've been up a long time.
BUT something is still very weird.
Doc1.php (loaded in web browser)
//contents of Doc1.php
include functions.php
include formProcessor.php
include form.php
Calling the protectText() function in functions.php from
formProcessor.php with data posted from form.php works on data posted
from textarea fields but does NOT on data posted from type=text.
//contents of functions.php ONLY works on textarea fields
The fundtion in function.php is:
function protectText($tv) {
   $tv = stripslashes($tv);
   $tv = str_replace(\,[QT],$tv);
   $tv = str_replace(\r,br,$tv);
   return $tv;
}
BUT if I put the same function in formprocessor.php it works!??
//contents of formprocessor.php THIS works on both
function TSTprotectText($tv) {
   $tv = stripslashes($tv);
   $tv = str_replace(\,[QT],$tv);
   $tv = str_replace(\r,br,$tv);
   return $tv;
}
TSTprotectText($_POST['field']);
Now how can that be?

Can you be a little more specific on what differences you get?
I normally use textarea for multi-line data and input type=text for one
line, short data... the only difference you might encounter that I can 
think
off the top of my head is maybe line break?

- Original Message -
From: Sam Smith [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Sunday, October 10, 2004 3:28 PM
Subject: [PHP] textarea vs. type=text data difference?

I have a form with both textarea and text type fields.
I submit it and do some processing on identical data and get different
results.
What's up with that.
Thank you.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] textarea vs. type=text data difference?

2004-10-10 Thread Sam Smith

htmlentities!

Thanks a lot for taking the time but it was just my nubie error.

What had me going all off in the wrong direction was textarea fields don't
need htmlentities to display quotes correctly like a text field does.

you know like this:  value=some text with important info
Displays in textarea fine but in type=text of course you get
some text

What a female dog.


 Okay, so in other words...
 
 //Doc1.php
 
 include functions.php //this file contains the function definition for
 protectText()
 include formProcessor.php //this file contains the code that calls
 protectText()
 include form.php //this file gets the form data from user
 
 By any chance, are ANY of the include files classes?  I'm not 100%
 sure(unless you put up some more code), but it sounds like it's maybe a
 scope error... especially if you define the function in formProcessor and it
 works fine...
 
 -Minuk
 
 - Original Message -
 From: Sam Smith [EMAIL PROTECTED]
 To: PHP [EMAIL PROTECTED]
 Sent: Sunday, October 10, 2004 4:25 PM
 Subject: Re: [PHP] textarea vs. type=text data difference?
 
 
 
 ##The data is the same. I've been up a long time.
 
 BUT something is still very weird.
 
 Doc1.php (loaded in web browser)
 //contents of Doc1.php
 include functions.php
 include formProcessor.php
 include form.php
 
 Calling the protectText() function in functions.php from
 formProcessor.php with data posted from form.php works on data posted
 from textarea fields but does NOT on data posted from type=text.
 
 //contents of functions.php ONLY works on textarea fields
 The fundtion in function.php is:
 function protectText($tv) {
$tv = stripslashes($tv);
$tv = str_replace(\,[QT],$tv);
$tv = str_replace(\r,br,$tv);
return $tv;
 }
 
 BUT if I put the same function in formprocessor.php it works!??
 
 //contents of formprocessor.php THIS works on both
 function TSTprotectText($tv) {
$tv = stripslashes($tv);
$tv = str_replace(\,[QT],$tv);
$tv = str_replace(\r,br,$tv);
return $tv;
 }
 
 TSTprotectText($_POST['field']);
 
 Now how can that be?
 
 
 Can you be a little more specific on what differences you get?
 
 I normally use textarea for multi-line data and input type=text for one
 line, short data... the only difference you might encounter that I can
 think
 off the top of my head is maybe line break?
 
 
 - Original Message -
 From: Sam Smith [EMAIL PROTECTED]
 To: PHP [EMAIL PROTECTED]
 Sent: Sunday, October 10, 2004 3:28 PM
 Subject: [PHP] textarea vs. type=text data difference?
 
 
 
 I have a form with both textarea and text type fields.
 
 I submit it and do some processing on identical data and get different
 results.
 
 What's up with that.
 
 Thank you.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php