muba has asked for the wisdom of the Perl Monks concerning the following question:
A stupid and slighly long introduction
I wrote a pretty small online editor which allows me to easily change a couple of files on my webserver without having the need of using FTP.
Or so I thought.
The editor consists of a small form with a textarea and a submit button (oh and besides, for a little feeling of fake security, there is a password box :) ).
This form gets submitted to a Perl script which gets the form information through use CGI 'param' (because param is the only function of the CGI module I use).
The stupid problem
But the data from the textarea does not equal the data I entered. HTML entities like <, , \ are changed by their actual characters.
A stupid solution
Of course I could write &lt; in the editor (this would then render as < which is what I want) but then I should re-edit any HTML entities any time. As you can see, I don't quite feel like it.
The (stupid?) question
So my actual question(s): why does CGI eat them character entities? And how can I prevent it?
I could of course roll my own form parser, but that's, well, just stupid.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI module seems to eat html entities!
by Jenda (Abbot) on Oct 03, 2005 at 14:00 UTC | |
by muba (Priest) on Oct 03, 2005 at 14:13 UTC | |
by Jenda (Abbot) on Oct 03, 2005 at 14:18 UTC | |
|
Re: CGI module seems to eat html entities!
by marto (Cardinal) on Oct 03, 2005 at 14:02 UTC | |
by muba (Priest) on Oct 03, 2005 at 14:16 UTC | |
by SamCG (Hermit) on Oct 03, 2005 at 23:06 UTC |