+ Reply to Thread
Results 1 to 12 of 12

Use XMLHTTP to log on website and then post data

  1. #1
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Use XMLHTTP to log on website and then post data

    i need to input data to our company's internal webpages, and first have to log on with userid and password,

    i can use the following code to post the userid and password,

    Please Login or Register  to view this content.
    Then the next step is to post data, i try to follow with the codes below, but then the responsetext returned is blank,

    Please Login or Register  to view this content.
    How to log on first,then post data ?

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Use XMLHTTP to log on website and then post data

    You need to use the winhttp request object rather than XML since it will look after the cookies for you. The syntax is identical though

  3. #3
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Re: Use XMLHTTP to log on website and then post data

    Thanks, after i changed to CreateObject("WinHttp.WinHttpRequest.5.1"), it is the same, after the first post, i can get the responsetext, but after the second, the responsetext is still blank,

  4. #4
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Re: Use XMLHTTP to log on website and then post data

    can not find method how to solve the problem ?

  5. #5
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Re: Use XMLHTTP to log on website and then post data

    is there someone that have some tips about such problem ?

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Use XMLHTTP to log on website and then post data

    You need to work out whether your log on script is actually working, have you checked the response from the first POST to check that you have logged on successfully?

  7. #7
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Re: Use XMLHTTP to log on website and then post data

    Thanks Kyle123,
    yes, i checked in the responsetext, the first post is successfull,

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Use XMLHTTP to log on website and then post data

    So you are successfully logged on, can you access other logged in areas that use get requests rather than post?

  9. #9
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Re: Use XMLHTTP to log on website and then post data

    Quote Originally Posted by Kyle123 View Post
    So you are successfully logged on, can you access other logged in areas that use get requests rather than post?
    other logged in area ? what that mean ?

  10. #10
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Use XMLHTTP to log on website and then post data

    Another area that requires you to log-in on the site. Can you return the data?

    Also - you are still using WinHTTPRequest aren't you?

  11. #11
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Re: Use XMLHTTP to log on website and then post data

    Quote Originally Posted by Kyle123 View Post
    Another area that requires you to log-in on the site. Can you return the data?

    Also - you are still using WinHTTPRequest aren't you?
    Thanks, i found the reason, first i log in, and then normally go to the second page, but i missed the second page, and go to the third page directly,

    it is strange that: when i used POST, there is URL specifed, why the second page can not be be passed ?

  12. #12
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Use XMLHTTP to log on website and then post data

    I don't know, to be honest it's difficult to speculate without looking, but maybe the search query is cached and the cached request id is sent via a cookie - since the initial request hasn't been sent there's no cached table. This is just a guess and pure speculation though

  13. #13
    Registered User
    Join Date
    04-18-2008
    Posts
    8

    Re: Use XMLHTTP to log on website and then post data

    Quote Originally Posted by Kyle123 View Post
    I don't know, to be honest it's difficult to speculate without looking, but maybe the search query is cached and the cached request id is sent via a cookie - since the initial request hasn't been sent there's no cached table. This is just a guess and pure speculation though
    i noticed that the referer point to the previous page, i don' whether it is the reason,

    one more problem, for the posted data, it is like this:

    ship_type=wt&ship_from=3&coats_order=&req_reason=FOR+1Q%2713+SYSTEM+X+RESALE&lab_owned=no&classification=unclassified&reqinfo_button=Next

    The req_reason is "FOR 1Q'13 SYSTEM X RESALE", how 1Q'13 turn to be 1Q%27 ? what's the logic?

    is there some function to convert the source text to be the format in posted data ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1