1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Twiends PHP login

Discussion in 'PHP & Perl' started by arwor, May 9, 2011.

  1. arwor

    arwor Newbie

    Joined:
    Jun 21, 2010
    Messages:
    20
    Likes Received:
    0
    Hi, I need to login to twiends page with cUrl and PHP. Problem is that twiends login is with ajax. Anyone have script or code example in PHP?
     
  2. Stalli0n

    Stalli0n Junior Member

    Joined:
    Nov 17, 2010
    Messages:
    115
    Likes Received:
    83
    Location:
    Europe
    Well i just ran LiveHttpHeaders and it looks like a normal POST request.

    Code:
    http://twiends.com/
    
    POST / HTTP/1.1
    Host: twiends.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    X-MicrosoftAjax: Delta=true
    Cache-Control: no-cache, no-cache
    Content-Type: application/x-www-form-urlencoded; charset=utf-8
    Referer: http://twiends.com/
    Content-Length: 884
    Cookie: .........
    Pragma: no-cache
    ctl00%24ScriptManager1=ctl00%24UP1%7Cctl00%24LoginCloud1%24Login&__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=.....&__EVENTVALIDATION=.....&ctl00%24LoginCloud1%24TextBoxUsername=Stalli0n&ctl00%24LoginCloud1%24TextBoxPassword=secret&ctl00%24CPR%24Signup1%24TextBoxUsername=&ctl00%24CPR%24Signup1%24TextBoxPassword=&ctl00%24CPR%24Signup1%24TextBoxEmail=&__ASYNCPOST=true&ctl00%24LoginCloud1%24Login=%C2%A0
    Have you tried that already?
     
  3. arwor

    arwor Newbie

    Joined:
    Jun 21, 2010
    Messages:
    20
    Likes Received:
    0
    Yes, I have read LiveHttpHeaders and I set that post with CUrl, but it don't let me in. I don't know why.
     
  4. arwor

    arwor Newbie

    Joined:
    Jun 21, 2010
    Messages:
    20
    Likes Received:
    0
    In response I get:
    "29|pageRedirect||/?aspxerrorpath=/default.aspx|"
     
  5. Stalli0n

    Stalli0n Junior Member

    Joined:
    Nov 17, 2010
    Messages:
    115
    Likes Received:
    83
    Location:
    Europe
    Maybe you got something wrong with the post data / header or forgot something.
     
  6. xpwizard

    xpwizard Junior Member

    Joined:
    Nov 6, 2010
    Messages:
    198
    Likes Received:
    122
    If you want further help, post your script (the login part) so that we can test it.
     
  7. gnote

    gnote Registered Member

    Joined:
    Mar 10, 2009
    Messages:
    80
    Likes Received:
    6
    Occupation:
    Programmer
    Location:
    USA
    AJAX requests are the same thing as a regular HTTP request, and will show when logged with LiveHTTPHeaders.

    Not sure what you problem is here, but since you are performing an AJAX request you wont see the response you are looking for. However, the AJAX response you do receive should have the login cookies in the header. After you send the login POST, store the response cookies and send another request for the main page http://twiends.com/twitter. If your login worked, it will show you as logged in.