POSTing a form programatically with cURL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Grey Alien

    #1

    POSTing a form programatically with cURL

    Apologies for the cross post. I am quite desperate and do not know which
    ng would be the most appropriate.

    I am trying to programatically POST an ASP form, to allow me to log on
    to a site programatically .

    <form name="aspnetFor m" method="post" action="Default .aspx"
    id="aspnetForm" >
    <input name="_ct99:Con tent:UsrName" type="text"
    id="_ct99_Conte nt_UsrName" />
    <input name="_ct99:Con tent:Pwd" type="password"
    id="_ct99_Conte nt_Pwd" />
    <input type="submit" name="_ct99:Con tent:btnLogon" value="Logon"
    id="_ct99_Conte nt_btnLogon" />
    <input id="_ct99_Conte nt_SavePwd" type="checkbox"
    name="_ct99:Con tent:SavePwd" /></p>
    </form>


    Could anyone please specify the data I should pass with the
    CURLOPT_POSTFIE LDS flag option (i.e. passed to curl_easy_setop t()) ?
    I have not been succesful so far in trying to log on.
  • Manuel Lemos

    #2
    Re: POSTing a form programatically with cURL

    Hello,

    on 07/12/2007 04:42 AM Grey Alien said the following:
    Apologies for the cross post. I am quite desperate and do not know which
    ng would be the most appropriate.
    >
    I am trying to programatically POST an ASP form, to allow me to log on
    to a site programatically .
    >
    <form name="aspnetFor m" method="post" action="Default .aspx"
    id="aspnetForm" >
    <input name="_ct99:Con tent:UsrName" type="text"
    id="_ct99_Conte nt_UsrName" />
    <input name="_ct99:Con tent:Pwd" type="password"
    id="_ct99_Conte nt_Pwd" />
    <input type="submit" name="_ct99:Con tent:btnLogon" value="Logon"
    id="_ct99_Conte nt_btnLogon" />
    <input id="_ct99_Conte nt_SavePwd" type="checkbox"
    name="_ct99:Con tent:SavePwd" /></p>
    </form>
    >
    >
    Could anyone please specify the data I should pass with the
    CURLOPT_POSTFIE LDS flag option (i.e. passed to curl_easy_setop t()) ?
    I have not been succesful so far in trying to log on.
    I rarely use Curl, only as fallback for when it is not possible to
    execute SSL fsockopen requests for some reason.

    What I use is this HTTP client class that abstracts me everything about
    an HTTP connection. Submitting a form just requires me to pass an
    associative array with field names and their values. Take a look at the
    test_http_post. php example:

    http://www.phpclasses.org/httpclient


    --

    Regards,
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator


    PHP Classes - Free ready to use OOP components written in PHP
    http://www.phpclasses.org/

    Comment

    Working...