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" <php@xxxxxxxx> > To: "PHP" <php-general@xxxxxxxxxxxxx> > Sent: Sunday, October 10, 2004 4:25 PM > Subject: Re: 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" <php@xxxxxxxx> >>> To: "PHP" <php-general@xxxxxxxxxxxxx> >>> Sent: Sunday, October 10, 2004 3:28 PM >>> Subject: 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