Cookie help!

Discussion in 'Questions (Windows Mobile)' started by erkinkarakoc, May 28, 2009.

  1. erkinkarakoc

    erkinkarakoc New Member

    My codes are;



    Sub Globals
    'Declare the global variables here.
    URL ="http://trophymanager.com/index.php"
    postdata="brugernavn=username&adgangskode=password"
    Dim buffer(0) As byte
    Dim s
    Dim cookie,sessid
    End Sub

    Sub App_Start
    Form1.Show
    End Sub


    Sub Button1_KeyPress (key)

    End Sub

    Sub Button1_Click


    Request.New1(URL)


    Request.ContentLength = StrLength(postdata)
    Request.Method = "POST"
    Request.ContentType = "application/x-www-form-urlencoded"
    request.KeepAlive=False

    stream.New1(Request.GetStream,True)
    stream.WriteBytes (stream.StringToBytes(postdata))
    Response.New1
    Response.Value = Request.GetResponse
    s=response.Headers
    s=SubString(s,StrIndexOf(s,"Set-Cookie",0)+12,StrIndexOf(s,"expires",0)-StrIndexOf(s,"Set-Cookie",0)-14)
    cookie=SubString(s,StrIndexOf(s,"PHPSESSID",0),StrIndexOf(s,";",StrIndexOf(s,"PHPSESSID",0))-StrIndexOf(s,"PHPSESSID",0))
    sessid=cookie
    cookie=cookie& "; " & SubString(s,StrIndexOf(s,"cid=",0),StrLength(s))


    textbox1.text = Response.GetString

    Response.Close


    End Sub





    Sub Button2_Click
    Request.New1("http://www.trophymanager.com/squad.php?"& sessid ) 'Build the request.

    Response.New1
    Response.Value = Request.GetResponse 'Call the server
    textbox1.text = Response.GetString 'Get the string from the response stream.
    Response.Close
    End Sub


    running this program but dont log in. help me.
    sorry my bad english :sign0013:
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice