Code:
Ok, this is a common problem and if there was an easy answer I'm sure I'd already know it. Infact I do, but my head hurts so I'll carry on before jumpin in bed at 4:33am as it is now ...
Basically, when a user submits info in a form, yuo can pass it through filters like stripslashes, replace < and > with their html equivilents of > and <l;, and basically prepare them so that they can be stored in a text file but then displayed ok on a browser, but not allowing any malicious code that way.
However, the problem is what if you have a system like mine where there is a masterphp page that does all the work, and if you've not filled out the form yet it includes a form, if you've filled it out it filters the stuff and gives you a retry form if ther were errors and an confirm form if there weren't. The confirm form points back to the retry form if you say no and to the page that does the writing work if you say yes.
My problem is that, basically, things get screwed up when passed around as hidden form inputs. Well, they seemed to be fine until I used a textarea. I've used one before but that wasn't filtered as it didn't need to be stripped of code and didn't need to have linebreaks sustained.
Now I'm filtering one, as I need to remove dodgy code and replace \r with <br /> so that it displays in the browser correctly. However, whether it's just the <br />'s or not I dunno, but things screw up bigtime. So, I was wondring what people thought was the best way to pass around textarea data from page to page, and then the best process to put it through before saving.
Argh, my head, must sleep ...
Leozack
Code:
MakeUniverse($infinity,1,42);