What I'm curious about here is what kind of stuff are you taking? Comments? Guestbook? Loan application data?

If the stuff is not sensitive, and it's one time, you could set a cookie that says they submitted.

The cgi accepting the form data would first check if there is a previous record of this 'user' submitting data through this form.

Of course they could simply wipe out their cookie and submit again. But this method could be useful if the data is not sensitive, and what you are getting is more an annoyance then a security hole.

With a cookie and CGI::Session, you could do more interesting things. You can store just one cookie on their machine that identifies them as a client for you- and with a cgi session item, store multiple things like 'submitted_form_a', 'viewed_page_z' etc etc- and also, quite interestingly, you can store complex data structures in a cgi session (even objects?).

Cpan has very good documentation on how to implement CGI Session and use it to set cookies, retrieve them, etc.


In reply to Re: CGI and Sessions by leocharre
in thread CGI and Sessions by santhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.