cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Submitting form with strange __multiselect parameters

From: Rob Thomas <s4developer_at_gmail.com>
Date: Wed, 7 Aug 2013 15:20:46 -0500

NOTE: JAVASCRIPT CAN CHANGE A FORM JUST BEFORE SUBMISSION

it sounds like you may be missing a session variable. coping the from
source code and submitting the form locally that returns the submitted
request.

1.) create a copy of the web page that contains the form you want to
analyze, and place that copy on your hard drive
2.) replace the form handler (action=jsp) on the web page with a form
handler (action=yourformanalyzer) that will analyze the form structure.

# Initiate addresses

$action="http://www.localhost.com/save-location-on-your-hardrive.jsp";

# Set submission method

$method="POST";

# DATA_ARRAY THAT RETURNS POST VARIABLES

$data_array[];

# Would you like some

cookies with your request

$Cookie_Array[]:

On Wed, Aug 7, 2013 at 5:00 AM, <curl-and-php-request_at_cool.haxx.se> wrote:

> Send curl-and-php mailing list submissions to
> curl-and-php_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> or, via email, send a message with subject or body 'help' to
> curl-and-php-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-and-php-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-and-php digest..."
>
>
> Today's Topics:
>
> 1. Submitting form with strange __multiselect parameters
> (Oscar Vidal)
> 2. Re: Submitting form with strange __multiselect parameters
> (Waruna Geekiyanage)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 7 Aug 2013 17:02:20 +0800
> From: Oscar Vidal <oscarblo_at_gmail.com>
> To: curl-and-php_at_cool.haxx.se
> Subject: Submitting form with strange __multiselect parameters
> Message-ID:
> <CAE9GNTm=YE7+569gcsEhY_0Y69yPmGnJu2bY90jh1=FAnmWN=
> g_at_mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi!
>
> I'm trying to submit a (java servlet) form using CURL in PHP, but it seems
> like there is a problem with the parameters. I cant really understand why
> its happening since I'm testing the CURL with a identical string parameters
> that is being used by the browser.
>
> After some research in diverse forums I wasn't able to find a solution to
> my particular problem.
>
> this is the POSTFIELDS string generated by the browser (and working):
>
>
> submissionType=pd&__multiselect_PostCodeList=&selectedPostCode=01&selectedPostCode=02&selectedPostCode=03&__multiselect_selectedPostCodes=
>
> and I'm using and identical (for testing) string in the PHP script but it
> im getting a HTML file as a answers telling "Missing parameters in search
> query".
>
> I believe that the form
>
> __multiselect_PostCodeList=
> &selectedPostCode=01
> &selectedPostCode=02
> &selectedPostCode=03
> &__multiselect_selectedPostCodes=
>
> is quite wired (never see before this) and I'm wondering that it can be the
> reason of why the post is not working from CURL.
>
> The form seems to be successfully submitted since I'm getting this header
>
> HTTP/1.1 200 OK
> Date: Wed, 07 Aug 2013 08:02:56 GMT
> Content-length: 1791
> Content-type: text/html;charset=UTF-8
> X-Powered-By: Servlet/2.4 JSP/2.0
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Connection: Keep-Alive
>
> Note: I tried submitting the same form from *Lynx* and I'm also getting the
> same result ("Missing parameters in search query"). So it seems like its
> only working with browsers like Mozilla or Chrome.
>
> Please some help will be really appreciated, I don't have any more ideas at
> this point.
>
> Thanks! Oscar
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-and-php/attachments/20130807/cf9fac97/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Wed, 07 Aug 2013 15:14:37 +0530
> From: Waruna Geekiyanage <waruna.ns_at_gmail.com>
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Subject: Re: Submitting form with strange __multiselect parameters
> Message-ID: <52021705.2060207_at_gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> submit your PHP/cURL code, so that we can give a clear answer.
>
> Use following settings to submit POST data
> curl_setopt ($ch, CURLOPT_POST, 1);
> curl_setopt ($ch, CURLOPT_POSTFIELDS, $arr_postdata);
>
> $arr_postdata - field name as key and field data as value
>
> use following setting for debugging
>
> curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
> $info = curl_getinfo($ch, CURLINFO_HEADER_OUT);
>
> $info will give the request headers.
>
> Thank You,
> Waruna Geekiyanage
>
> M: +94 71 4168164
> E: waruna.ns_at_gmail.com <mailto:warunans_at_gmail.com>
> MSN: warunans_at_hotmail.com
> GTalk: waruna.ns
> ICQ: 225184383
> Yahoo: warunans
> Skype: warunans
>
> On 8/7/2013 2:32 PM, Oscar Vidal wrote:
> >
> > Hi!
> >
> > I'm trying to submit a (java servlet) form using CURL in PHP, but it
> > seems like there is a problem with the parameters. I cant really
> > understand why its happening since I'm testing the CURL with a
> > identical string parameters that is being used by the browser.
> >
> > After some research in diverse forums I wasn't able to find a solution
> > to my particular problem.
> >
> > this is the POSTFIELDS string generated by the browser (and working):
> >
> >
> |submissionType=pd&__multiselect_PostCodeList=&selectedPostCode=01&selectedPostCode=02&selectedPostCode=03&__multiselect_selectedPostCodes=
> > |
> >
> > and I'm using and identical (for testing) string in the PHP script but
> > it im getting a HTML file as a answers telling "Missing parameters in
> > search query".
> >
> > I believe that the form
> >
> > |__multiselect_PostCodeList=
> > &selectedPostCode=01
> > &selectedPostCode=02
> > &selectedPostCode=03
> > &__multiselect_selectedPostCodes=
> > |
> >
> > is quite wired (never see before this) and I'm wondering that it can
> > be the reason of why the post is not working from CURL.
> >
> > The form seems to be successfully submitted since I'm getting this header
> >
> > |HTTP/1.1 200 OK
> > Date: Wed, 07 Aug 2013 08:02:56 GMT
> > Content-length: 1791
> > Content-type: text/html;charset=UTF-8
> > X-Powered-By: Servlet/2.4 JSP/2.0
> > Vary: Accept-Encoding
> > Content-Encoding: gzip
> > Connection: Keep-Alive
> > |
> >
> > Note: I tried submitting the same form from /Lynx/ and I'm also
> > getting the same result ("Missing parameters in search query"). So it
> > seems like its only working with browsers like Mozilla or Chrome.
> >
> > Please some help will be really appreciated, I don't have any more
> > ideas at this point.
> >
> > Thanks! Oscar
> >
> >
> >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-and-php/attachments/20130807/9261851f/attachment-0001.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> curl-and-php mailing list
> curl-and-php_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>
> ------------------------------
>
> End of curl-and-php Digest, Vol 90, Issue 1
> *******************************************
>

-- 
*“Teach Them Better Principles and The People Will Govern Themselves”*
*
*

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2013-08-07