I've got a form that uses POST and has three image buttons that act as submit buttons. Clicking on one of the images submits the form and sends you to a certain page associated with the image you chose. WWW::Mech is unavailable. I was told that I must send this in the header:

Input_tag_name.x=0&Input_tag_name.y=0

Where the Input_tag_name is the name value of the image I want. Okay, but how do I use headers when my code looks like this:

my $browser = LWP::UserAgent->new; my $response = $browser->post( 'https://www.whatever.com/asdf.cgi', [ 'id' => $id, 'passwd' => $pass, ], ); die "Error: ", $response->status_line unless $response->is_success;

In other words, I want to send the headers and the rest of the POST data as shown above. Do I need to use a separate module or can I do this with LWP? Thanks.


In reply to LWP & image submit buttons by Anonymous Monk

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.