Hope that I can explain my problem clearly:
1. I have a long form, created from a "xyz.cgi" (action="" that means
is empty)
2. The user fills up the form and sends (action="send") The
parameters are send with an self reference to the same "xyz.cgi". This
script examines with several routines the user-input. If everything is
alright the script is sending back a
3. confirmation page, which is containing also a form, but only with
one button: "cancel" and everything as text, which where filled into
the first form. This page is saying, that everything is alright so
far. But if the user has some doubts, or if there has been an error,
he may push the button "cancel"
4. The cancel-page (action="cancel") should show once again the
parameters of step 3, which the user filled up in step 2 ...
How do I save the parameters from the first input? I tried everything,
but there is nothing kept in my array. Do I have to save these
parameters into an external file?
Hope that my English was explaining good enough my problem. The script
itself is much to long ...
Best greetings from Munich
marek
An alternative would be storing the whole CGI-object in a file using
Data::Dumper and recreate it using 'do $file'.
Greetings
Robert
Marek schrieb:
User Data Validation is best preformed using JavaScript on the users browser
, checking for junk should be done on the server side . You might want to
approach the problem from a different perspective
Greg
.
Thank you Robert! I will try both solutions tomorrow ...
Have a nice weekend!
marek
Hi!
> How do I save the parameters from the first input? I tried everything,
> but there is nothing kept in my array. Do I have to save these
> parameters into an external file?
You could also use Storable & Base64 to encode your data structure into
a Base64 string. Put this string into a hidden text field. When the
second form is submitted, you can decode your original data structure
from that hidden field.
That way, you don't have to store ANYTHING on your server until the user
hits the final SUBMIT.
Something like this could do the trick:
<http://search.cpan.org/~cavac/Maplat-0.9/lib/Maplat/Helpers/DBSerialize.pm>
I originally wrote it to store perl data structures into a database text
field, should work in a hidden HTML form, too. Something like this:
<input type="hidden" name="foo" value="YourEncodedString">
LG
Rene