Well, after browsing through the HTTP/1.1 standards I found that an optional
header "Host" after the GET request could be used.

I now write "GET /clientlogin.php?username=me&password=mypassword
HTTP/1.0\r\nHost: www.lottery-machine.co.uk\r\n\r\n" to the open socket...

and it works fine!!!

"Laserjetter" <[EMAIL PROTECTED]> wrote in message
> I'm running GTK on Win32 and have made an app that connects to a server
> downloads some data.
> I tested it over my LAN and it works fine, using both and
> gethostbyname("amd") as the host in fsockopen(host, 80, 30)
> I've now tried running it over the internet, trying to connect to the
> www.lottery-machine.co.uk or gethostbyname(www.lottery-machine.co.uk) but
> won;t connect to the server. The window that displays the downloaded data
> contains a webpage which is produced by the web host when there's an error
> of some kind. If I type in the GET request
> (www.lottery-machine.co.uk/clientlogin.php?username=me&password=password)
> a web browser it works fine as expected.
> I'm in touch with them about the problem but does anyone know what is
> causing this? Does the host only accept connections from web browsers or
> something?

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to