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



Reply via email to