Gary Petersen wrote:
A horsie named william c demonstrated surprising intelligence and its
ability to use morse code on Thu, 11 Sep 2003 15:36:11 -0500 when it
tapped <3F***************@williamc.com> with its hoof:
<chuckle />
When the validation fails, save the POST data into a
session variable and redirect to the form page.
When the form page loads, put the
saved post data into the form elements:
Ok, thinking out load here... Does this make sense? Currently this page
uses javascript to validate and after it validates, submits to the Perl
program. Normally, when it validates on the client side it validates on
the server side, too. But it could fail if the Perl code strips out a
lot of evil characters (not that I care about making it convenient to
re-enter in that case) or if the user has js turned off.
If I move the data checking and cleansing out of the Perl and into a PHP
function, since it's happening on the server, that should be as reliable
as doing it in the cgi. Only after it gets past the PHP validation
function do I submit it to the Perl. Then, the Perl should fail only if
the insert into the db etc. fails, in which case I'm probably screwed
anyway...
So maybe that's what I should do, and not even use a session. And maybe
rewrite everything to use just PHP to validate, make the connection to
the db, insert the data etc... I have the O'Reilly PHP book, I guess I
should read it.
thx for the help,
williamc