Re: [PHP] socket communication programming

2009-06-14 Thread Andrew Ballard
On Sat, Jun 13, 2009 at 4:58 PM, HELP! wrote:
> On Sat, Jun 13, 2009 at 10:28 PM, Manuel Lemos  wrote:
>
>> Hello,
>>
>> on 06/12/2009 11:41 AM HELP! said the following:
>> > hi
>> > I can not get the stream_get_contents() to work.  it's returning empty.
>> > If you have a login details "ALOGINPASS 1A" cant you just fwrite($ft,
>> > "ALOGINPASS 1A"); or do you need to add other things
>> >
>> >
>> > what is the meaning of this string" GET / HTTP/1.0\r\nHost:
>> > www.example.com\r\nAccept :
>> */*\r\n\r\n"
>>
>> If that is regular HTTP, why don't you try an HTTP client class that
>> lets you customize your request parameters like this one?
>>
>> http://www.phpclasses.org/httpclient
>>
>> --
>>
>> Regards,
>> Manuel Lemos
>>
>> Find and post PHP jobs
>> http://www.phpclasses.org/jobs/
>>
>> PHP Classes - Free ready to use OOP components written in PHP
>> http://www.phpclasses.org/
>>
> Thanks. I need to access remote data via TCP. Connecting to the given
> port has been successful but getting acknowledgement from the remote server
> after sending the login packet is a problem. Is there anything wrong sending
> the login packet in strings? or what is the best way?
>
> I probably think the server is not detecting the end of the login message.
> Is there anyway you can add END of message to login package specified.
>
> Thnaks
>
>
>


The sample request you posted earlier is, as Shawn already pointed
out, malformed. If that is truly what you are sending (and that isn't
just a typo), you won't get the results you want.

If all you are trying to do is fetch data from a remote web server,
one of the packaged libraries like HTTPrequest will probably be all
you need. That way the code behind the API will make sure your
requests are well formed, and they also usually have handling built in
to detect HTTP response codes and follow redirect headers. All you
have to worry about is plugging the right data into the right places
in the API.

Andrew

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



Re: [PHP] socket communication programming

2009-06-13 Thread HELP!
Thanks. I need to access remote data via TCP. Connecting to the given
port has been successful but getting acknowledgement from the remote server
after sending the login packet is a problem. Is there anything wrong sending
the login packet in strings? or what is the best way?

I probably think the server is not detecting the end of the login message.
Is there anyway you can add END of message to login package specified.

Thnaks



On Sat, Jun 13, 2009 at 10:28 PM, Manuel Lemos  wrote:

> Hello,
>
> on 06/12/2009 11:41 AM HELP! said the following:
> > hi
> > I can not get the stream_get_contents() to work.  it's returning empty.
> > If you have a login details "ALOGINPASS 1A" cant you just fwrite($ft,
> > "ALOGINPASS 1A"); or do you need to add other things
> >
> >
> > what is the meaning of this string" GET / HTTP/1.0\r\nHost:
> > www.example.com\r\nAccept :
> */*\r\n\r\n"
>
> If that is regular HTTP, why don't you try an HTTP client class that
> lets you customize your request parameters like this one?
>
> http://www.phpclasses.org/httpclient
>
> --
>
> Regards,
> Manuel Lemos
>
> Find and post PHP jobs
> http://www.phpclasses.org/jobs/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>



-- 
www.bemycandy.com


Re: [PHP] socket communication programming

2009-06-13 Thread Manuel Lemos
Hello,

on 06/12/2009 11:41 AM HELP! said the following:
> hi
> I can not get the stream_get_contents() to work.  it's returning empty.
> If you have a login details "ALOGINPASS 1A" cant you just fwrite($ft,
> "ALOGINPASS 1A"); or do you need to add other things
> 
> 
> what is the meaning of this string" GET / HTTP/1.0\r\nHost:
> www.example.com\r\nAccept : */*\r\n\r\n"

If that is regular HTTP, why don't you try an HTTP client class that
lets you customize your request parameters like this one?

http://www.phpclasses.org/httpclient

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] socket communication programming

2009-06-12 Thread Shawn McKenzie
HELP! wrote:
> hi
> I can not get the stream_get_contents() to work.  it's returning empty.
> If you have a login details "ALOGINPASS 1A" cant you just fwrite($ft,
> "ALOGINPASS 1A"); or do you need to add other things
> 
Depends upon what the server is expecting.
> 
> what is the meaning of this string" GET / HTTP/1.0\r\nHost:
> www.example.com\r\nAccept : */*\r\n\r\n"

Those are some header from a get request, though looking malformed maybe.

> www.bemycandy.com
> 

-- 
Thanks!
-Shawn
http://www.spidean.com

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