Originally Posted By: starbucks_mafia
The problem is that the site you're trying to connect to uses cookies to store session data. If you don't provide the necessary cookies it uses the 302 to redirect you to http://www.melissadata.com/cgi-bin/cookie.asp.

You need to also be sending the necessary cookies in your request. To do this you have to connect to http://www.melissadata.com/lookups/iplocation.asp and parse the Set-Cookie header (it's basically just name=value pairs like HTTP GET parameters).

Unfortunately it looks like the cookies are actually manipulated by Javascript aswell so you'd need to find a way to perform the same manipulations as they appear in the source of iplocation.asp, including all the functions they call which are located in http://www.melissadata.com/cgi-bin/lib.js. I suppose you could manually read what Javascript functions are being called in iplocation.asp in the script tags and hard-code those function calls in your mIRC script, but then you'd have to create mIRC script equivalents for all the functions in lib.js. Another way might be to use COM objects and/or the Windows Script Host to run the Javascript (although that could be a major security issue).

Once that's all done you'd then have to send the cookies in your request via the Cookie header.

All in all it looks like a major headache. It's quite probable that they've intentionally done this to make it hard to programmatically use their IP Locator.

Just what I didn't want to hear. There are other websites that can do this same thing. Thanks smile