Simulate post at webpage

Discussion in 'C++' started by dast, Sep 15, 2005.

  1. dast

    dast Guest

    I want to simulate an input and post into a web page and than download
    the web page that is opened after the correct input! The web page
    exists of an user input form with userid and password, after input the
    correct data and pressing the submit button another web page will be
    opened.

    I have tried to download the web page with the following code (I am
    using the CAmHttpSocket class at
    http://www.codeproject.com/internet/amhttputils.asp):

    int _tmain(int argc, _TCHAR* argv[])
    {
    CAmHttpSocket http;

    char* p = "userid=xxx&pwd=xxx";

    char* s = http.GetPage(
    _T("https://orawww.uibk.ac.at/public_prod/owa/pk205.frame_lv_termine_lzk?termin_id_in=3678"),
    true, p, strlen(p));

    int i = http.GetPageStatusCode();

    printf("%s\n", s);

    printf("%d\n", i);

    return 0;
    }

    My problem is that I don't know how to simulate the input and pressing
    the submit button!

    How can I pass the userid and the possword?

    Regards,
    Daniel.
    dast, Sep 15, 2005
    #1
    1. Advertising

  2. This is off-topic here.

    Try posting it to microsoft.public.vc.mfc newsgroup.

    --
    EventStudio 2.5 - http://www.EventHelix.com/EventStudio
    Generate Sequence diagrams from a simple declarative language
    EventHelix.com, Sep 15, 2005
    #2
    1. Advertising

  3. dast wrote:
    > I want to simulate an input and post into a web page and than download
    > the web page that is opened after the correct input! The web page
    > exists of an user input form with userid and password, after input the
    > correct data and pressing the submit button another web page will be
    > opened.
    >
    > I have tried to download the web page with the following code (I am
    > using the CAmHttpSocket class at
    > http://www.codeproject.com/internet/amhttputils.asp):
    >
    > int _tmain(int argc, _TCHAR* argv[])
    > {
    > CAmHttpSocket http;
    >
    > char* p = "userid=xxx&pwd=xxx";
    >
    > char* s = http.GetPage(
    > _T("https://orawww.uibk.ac.at/public_prod/owa/pk205.frame_lv_termine_lzk?termin_id_in=3678"),
    > true, p, strlen(p));
    >
    > int i = http.GetPageStatusCode();
    >
    > printf("%s\n", s);
    >
    > printf("%d\n", i);
    >
    > return 0;
    > }
    >
    > My problem is that I don't know how to simulate the input and pressing
    > the submit button!
    >
    > How can I pass the userid and the possword?
    >
    > Regards,
    > Daniel.
    >


    This is OT here, but you might want to look at 'wget' or 'curl'.

    /S.
    --
    Stefan Naewe
    naewe.s_AT_atlas_DOT_de
    =?ISO-8859-1?Q?Stefan_N=E4we?=, Sep 15, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Al Cadalzo

    How to simulate a form post?

    Al Cadalzo, Feb 17, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    7,551
    Al Cadalzo
    Feb 17, 2004
  2. delph
    Replies:
    3
    Views:
    1,327
    Andrea Desole
    May 13, 2005
  3. BarryX

    Simulate Form Post on Server Side

    BarryX, Sep 26, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    517
    Patrice
    Sep 26, 2007
  4. nospam
    Replies:
    1
    Views:
    437
    sloan
    Oct 13, 2007
  5. John A Grandy

    simulate post of .htm page to remotely hosted web-service

    John A Grandy, Aug 25, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    302
    John A Grandy
    Aug 25, 2004
Loading...

Share This Page