PDA

Click to See Complete Forum and Search --> : What's the difference?


vbDan
Aug 9th, 2000, 09:26 AM
I want my application to log-on to an ASP page and after
having done that send some data to another ASP page.

To log-on I need to send this URL:

http://www.mtnsms.com/session.asp?name=Login&username=somename&password=someword

And after having logged on I need to send this data
(to the newly given URL):

http://www1.mtnsms.com/sms/xsms.asp?frompage=login&name=newMsg&smsToNumbers=+0123456789&smsMessage=somemessage

Now, what I don't understand is that when I do this using the Internet Explorer Address Bar; this actually works.

But when I send the exact same data using Visual Basic (winsock API):

GET http://www.mtnsms.com/session.asp?name=Login&username=somename&password=someword

and after that:

GET http://www1.mtnsms.com/sms/xsms.asp?frompage=login&name=newMsg&smsToNumbers=+0123456789&smsMessage=somemessage

It doesn't work?

I get redirected to the default page saying that the last page required me to log-on (while I do get an object moved message and a new location after having sent my first string)?

Could somebody tell me what I am doing wrong? (And how to solve it?)

Does it have something to do with cookies? Or perhaps that my socket gets disconnected after I received the first page?

Any help would be appreciated!

kurtsimons
Aug 9th, 2000, 09:59 AM
Its because you are requesting the second page from the first server the servers are different you have to connect to the second server then request the page


TRY
---------
winsock.remotehost = "www.mtnsms.com"
Winsock.connect
-----------
GET /session.asp?name=Login&username=somename&password=someword HTTP/1.0
HOST:www.mtnsms.com

-----------------------
winsock.close
winsock.remotehost = "www1.mtnsms.com"
Winsock.connect
-----------------------


And after having logged on I need to send this data
(to the newly given URL):

GET /sms/xsms.asp?frompage=login&name=newMsg&smsToNumbers=+0123456789&smsMessage=somemessage
HOST:www.mtnsms.com


host should be on its own line

kurtsimons
Aug 10th, 2000, 05:50 AM
I can't tell you exactly how it works,

but ASP keeps it session information in "cookies". This is how the server knows who is comming back so it can continue on.

what i will do (since I want to know as well) is set up a "proxy type" program that watches data flow back and forth and see what is being send to-from


I'll get back to you

vbDan
Aug 10th, 2000, 10:24 AM
Thank you. It would be great to access this site using a VB-program. If you could access this site with your program you would be able to let your program send you sms messages :)

I'll be looking forward to see what you found out.