[Sockets]: Download a text for server usage
I can't seem to get the sockets to work properly, whats wrong with this code (new to socket and serious amxx coding), I don't get any errors and file is created but I don't get hold of the text from the host:
PHP Code:
|
Re: [Sockets]: Download a text for server usage
socket_open( "kz-scandinavia.com", 80, SOCKET_TCP, error );
|
Re: [Sockets]: Download a text for server usage
AoD90: I wrote the wrong code there :p suppose to be
PHP Code:
|
Re: [Sockets]: Download a text for server usage
Code:
|
Re: [Sockets]: Download a text for server usage
|
Re: [Sockets]: Download a text for server usage
I got it successfully to work BUT the host gave me this like if I was in the wrong link.
PHP Code:
|
Re: [Sockets]: Download a text for server usage
Show your HTTP request packet
|
Re: [Sockets]: Download a text for server usage
This is the code I have now:
PHP Code:
|
Re: [Sockets]: Download a text for server usage
Well your first step in debugging is to get a successful response. Have you tried to retrieve a file on a different server? Try google index.html or something.
After HTTP/1.1 you only have ^n, try using ^r^n. Not sure if it matters but it can't hurt to try. "GET /%s HTTP/1.1^nHost: %s^r^n^r^n" |
Re: [Sockets]: Download a text for server usage
How stupid, it worked when i added www. before the address I figure it couldn't find the address without it.
Now a new small problem occured, I don't recieve the whole .txt file from the host, just a bit of it, like 1/5 or something. EDIT: Fixed it with inserting a while loop. Now it works, thanks! ^^ |
| All times are GMT -4. The time now is 03:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.