Cookie help!

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:
 
Top