Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: submit button fails to pass the values using perl cgi?

by Anonymous Monk
on Feb 01, 2019 at 00:20 UTC ( [id://1229213]=note: print w/replies, xml ) Need Help??


in reply to Re: submit button fails to pass the values using perl cgi?
in thread submit button fails to pass the values using perl cgi?

"GET"! That solved it for me!Thank you!!!
  • Comment on Re^2: submit button fails to pass the values using perl cgi?

Replies are listed 'Best First'.
Re^3: submit button fails to pass the values using perl cgi?
by harangzsolt33 (Chaplain) on Feb 01, 2019 at 02:54 UTC
    Yeah, but keep in mind that when you use GET to send data, the form values are sent through the URL string. So, that's not very secure...

    If you use "POST" to submit form data, then you have to read those from STDIN in your perl script like so:

    # Usage: STRING = GetFormData()
    # Returns the form content as one giant string.

    sub GetFormData
    {
    my @L;
    while (<STDIN>)
    { push @L, $_; }
    @L or return '';
    return join('\n', @L);
    }

    ...

    my $FORM_DATA = GetFormData();

    (My Disclaimer: I'm a beginner perl programmer myself, so... what I say may not be 100% correct. LOL)

      If you use "POST" to submit form data, then you have to read those from STDIN in your perl script like so:

      Please don't. Use a library. There are several web frameworks, have a look around. If all else fails, just use the CGI module. Yes it's old, yes it's ugly, yes people say you should not use it, but it still works with very little efford, and for low-volume websites (intranet, home network), CGI is still good enough.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1229213]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-25 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found