[PHP] fsockopen question

2002-07-04 Thread Jose Arce

Hi, i'm making a script to transfer all the zips from my old server to my 
new one, i mean, server to server. That's the easy part. The cuestion is:

Can i open more than just one instance for fsockopen to retrieve more files 
in the same script, at the same time? i mean, not one by one (that will be 
slow), but 4 or 5 at the same time...
some people think it's possible, some people don't...thx :D

_
MSN. Más Útil cada Día. http://www.msn.es/intmap/


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




RE: [PHP] fsockopen question

2002-07-04 Thread Martin Towell

you can do more than one fsockopen(), but since php isn't multi-threaded -
you'll still only be able to download one file at a time.

-Original Message-
From: Jose Arce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 4:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] fsockopen question


Hi, i'm making a script to transfer all the zips from my old server to my 
new one, i mean, server to server. That's the easy part. The cuestion is:

Can i open more than just one instance for fsockopen to retrieve more files 
in the same script, at the same time? i mean, not one by one (that will be 
slow), but 4 or 5 at the same time...
some people think it's possible, some people don't...thx :D

_
MSN. Más Útil cada Día. http://www.msn.es/intmap/


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

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




RE: [PHP] fsockopen question

2002-07-04 Thread Jose Arce

So...i can do more than one fsockopen()...but is not multi-thread? i don't 
understand...i mean...if i can open more than one fsockopen...it is 
multithread, or in wich cases php open more than one fsockopen?
thx :D


From: Martin Towell [EMAIL PROTECTED]
To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question
Date: Thu, 4 Jul 2002 16:39:36 +1000

you can do more than one fsockopen(), but since php isn't multi-threaded -
you'll still only be able to download one file at a time.

-Original Message-
From: Jose Arce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 4:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] fsockopen question


Hi, i'm making a script to transfer all the zips from my old server to my
new one, i mean, server to server. That's the easy part. The cuestion is:

Can i open more than just one instance for fsockopen to retrieve more files
in the same script, at the same time? i mean, not one by one (that will be
slow), but 4 or 5 at the same time...
some people think it's possible, some people don't...thx :D

_
MSN. Más Útil cada Día. http://www.msn.es/intmap/


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




_
MSN Fotos: la forma más fácil de compartir e imprimir fotos. 
http://photos.msn.es/support/worldwide.aspx


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




RE: [PHP] fsockopen question

2002-07-04 Thread Martin Towell

I mean, you can do

?
// been a while, so syntax is prob. wrong :(
$sock1 = fsockopen($host, 80);
$sock2 = fsockopen($host, 80);

fputs($sock1, GET /file1.html HTTP/1.0\r\n\r\n);
fputs($sock2, GET /file2.html HTTP/1.0\r\n\r\n);

$content1 = fgets($sock1, 102400);
$content2 = fgets($sock1, 102400);

$fclose($sock1);
$fclose($sock2);
?

each of the fgets()'s will be executed sequentially. But there's two sockets
open...


-Original Message-
From: Jose Arce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 4:48 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question


So...i can do more than one fsockopen()...but is not multi-thread? i don't 
understand...i mean...if i can open more than one fsockopen...it is 
multithread, or in wich cases php open more than one fsockopen?
thx :D


From: Martin Towell [EMAIL PROTECTED]
To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question
Date: Thu, 4 Jul 2002 16:39:36 +1000

you can do more than one fsockopen(), but since php isn't multi-threaded -
you'll still only be able to download one file at a time.

-Original Message-
From: Jose Arce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 4:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] fsockopen question


Hi, i'm making a script to transfer all the zips from my old server to my
new one, i mean, server to server. That's the easy part. The cuestion is:

Can i open more than just one instance for fsockopen to retrieve more files
in the same script, at the same time? i mean, not one by one (that will be
slow), but 4 or 5 at the same time...
some people think it's possible, some people don't...thx :D

_
MSN. Más Útil cada Día. http://www.msn.es/intmap/


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




_
MSN Fotos: la forma más fácil de compartir e imprimir fotos. 
http://photos.msn.es/support/worldwide.aspx


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

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




Re: [PHP] fsockopen question

2002-07-04 Thread Tracker 1

you can do more than one fsockopen, which means you will have
multiple sockets open, however, these are part of the same thread
in the same process.. in other words, you can't do two things at
once by default.. with php-gtk, you can maybe have multiple user
events.. and not sure if you can emulate it..

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


Jose Arce [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 So...i can do more than one fsockopen()...but is not multi-thread? i don't
 understand...i mean...if i can open more than one fsockopen...it is
 multithread, or in wich cases php open more than one fsockopen?
 thx :D


 From: Martin Towell [EMAIL PROTECTED]
 To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] fsockopen question
 Date: Thu, 4 Jul 2002 16:39:36 +1000
 
 you can do more than one fsockopen(), but since php isn't multi-threaded -
 you'll still only be able to download one file at a time.
 
 -Original Message-
 From: Jose Arce [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 04, 2002 4:39 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] fsockopen question
 
 
 Hi, i'm making a script to transfer all the zips from my old server to my
 new one, i mean, server to server. That's the easy part. The cuestion is:
 
 Can i open more than just one instance for fsockopen to retrieve more files
 in the same script, at the same time? i mean, not one by one (that will be
 slow), but 4 or 5 at the same time...
 some people think it's possible, some people don't...thx :D
 
 _
 MSN. Más Útil cada Día. http://www.msn.es/intmap/
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




 _
 MSN Fotos: la forma más fácil de compartir e imprimir fotos.
 http://photos.msn.es/support/worldwide.aspx




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




RE: [PHP] fsockopen question

2002-07-04 Thread Jose Arce

now it's clear  thx :D
is not the same thing as:
while ($i  100) {
$sock = fsockopen($host, 80);
fputs($sock, GET /file.$i.html HTTP/1.0\r\n\r\n);
}
isn't?

From: Martin Towell [EMAIL PROTECTED]
To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question
Date: Thu, 4 Jul 2002 16:49:59 +1000

I mean, you can do

?
// been a while, so syntax is prob. wrong :(
$sock1 = fsockopen($host, 80);
$sock2 = fsockopen($host, 80);

fputs($sock1, GET /file1.html HTTP/1.0\r\n\r\n);
fputs($sock2, GET /file2.html HTTP/1.0\r\n\r\n);

$content1 = fgets($sock1, 102400);
$content2 = fgets($sock1, 102400);

$fclose($sock1);
$fclose($sock2);
?

each of the fgets()'s will be executed sequentially. But there's two 
sockets
open...


-Original Message-
From: Jose Arce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 4:48 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question


So...i can do more than one fsockopen()...but is not multi-thread? i don't
understand...i mean...if i can open more than one fsockopen...it is
multithread, or in wich cases php open more than one fsockopen?
thx :D


 From: Martin Towell [EMAIL PROTECTED]
 To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] fsockopen question
 Date: Thu, 4 Jul 2002 16:39:36 +1000
 
 you can do more than one fsockopen(), but since php isn't multi-threaded 
-
 you'll still only be able to download one file at a time.
 
 -Original Message-
 From: Jose Arce [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 04, 2002 4:39 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] fsockopen question
 
 
 Hi, i'm making a script to transfer all the zips from my old server to my
 new one, i mean, server to server. That's the easy part. The cuestion is:
 
 Can i open more than just one instance for fsockopen to retrieve more 
files
 in the same script, at the same time? i mean, not one by one (that will 
be
 slow), but 4 or 5 at the same time...
 some people think it's possible, some people don't...thx :D
 
 _
 MSN. Más Útil cada Día. http://www.msn.es/intmap/
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




_
MSN Fotos: la forma más fácil de compartir e imprimir fotos.
http://photos.msn.es/support/worldwide.aspx


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

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




_
Únase al mayor servicio mundial de correo electrónico: 
http://www.hotmail.com/es


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




RE: [PHP] fsockopen question

2002-07-04 Thread Martin Towell

That's still running sequentially

-Original Message-
From: Jose Arce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 5:01 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question


now it's clear  thx :D
is not the same thing as:
while ($i  100) {
$sock = fsockopen($host, 80);
fputs($sock, GET /file.$i.html HTTP/1.0\r\n\r\n);
}
isn't?

From: Martin Towell [EMAIL PROTECTED]
To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question
Date: Thu, 4 Jul 2002 16:49:59 +1000

I mean, you can do

?
// been a while, so syntax is prob. wrong :(
$sock1 = fsockopen($host, 80);
$sock2 = fsockopen($host, 80);

fputs($sock1, GET /file1.html HTTP/1.0\r\n\r\n);
fputs($sock2, GET /file2.html HTTP/1.0\r\n\r\n);

$content1 = fgets($sock1, 102400);
$content2 = fgets($sock1, 102400);

$fclose($sock1);
$fclose($sock2);
?

each of the fgets()'s will be executed sequentially. But there's two 
sockets
open...


-Original Message-
From: Jose Arce [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 4:48 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question


So...i can do more than one fsockopen()...but is not multi-thread? i don't
understand...i mean...if i can open more than one fsockopen...it is
multithread, or in wich cases php open more than one fsockopen?
thx :D


 From: Martin Towell [EMAIL PROTECTED]
 To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] fsockopen question
 Date: Thu, 4 Jul 2002 16:39:36 +1000
 
 you can do more than one fsockopen(), but since php isn't multi-threaded 
-
 you'll still only be able to download one file at a time.
 
 -Original Message-
 From: Jose Arce [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 04, 2002 4:39 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] fsockopen question
 
 
 Hi, i'm making a script to transfer all the zips from my old server to my
 new one, i mean, server to server. That's the easy part. The cuestion is:
 
 Can i open more than just one instance for fsockopen to retrieve more 
files
 in the same script, at the same time? i mean, not one by one (that will 
be
 slow), but 4 or 5 at the same time...
 some people think it's possible, some people don't...thx :D
 
 _
 MSN. Más Útil cada Día. http://www.msn.es/intmap/
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




_
MSN Fotos: la forma más fácil de compartir e imprimir fotos.
http://photos.msn.es/support/worldwide.aspx


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

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




_
Únase al mayor servicio mundial de correo electrónico: 
http://www.hotmail.com/es

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




[PHP] fsockopen question

2001-04-26 Thread Michael Conley

I am looking to process credit card transactions on my site.  In order to do
this, I need to open a socket to a particular URL.  I then submit an XML
string to them.  They process the string and send me a response.

I am going to a certain (secure) location on the site of my credit card
processor (https://www.myprovider.com/XMLSubmit/processtrans.asp) and then
submit the XML string.  After I submit all of the XML, the processor will
give me a response as to whether or not the transaction is approved.

How do I send the XML string to the above URL?  When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com).  I don't even really see where to force this to go over
HTTPS.  I set the port to 443, but need to be sure that the data going
across uses SSL.

How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.asp?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


RE: [PHP] fsockopen question

2001-04-26 Thread Matthew Luchak

I use:

$fp = fsockopen(www.somewhere.com,80); 
fputs($fp, GET http://www.somewhere.com/somedir/somepage.html
HTTP/1.0\r\n\r\n);

to parse.  Should be easily modified

 
Matthew Luchak 
Webmaster
Kaydara Inc. 
[EMAIL PROTECTED]


-Original Message-
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 12:37 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] fsockopen question



How do I send the XML string to the above URL?  When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com).  I don't even really see where to force this to go
over
HTTPS.  I set the port to 443, but need to be sure that the data going
across uses SSL.

How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.asp?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] fsockopen question

2001-04-26 Thread Matthew Luchak


$fp = fsockopen(www.somewhere.com,4096); 

here you have to check the syntax for POST and HTTPS but I THINK
(hoo-boy am I ever risking ridicule) it should look something like this:

fputs($fp, POST https://www.somewhere.com/dir/app  HTTPS/1.0\r\n\r\n,
$xmlstring); 


then try the response..

 
Matthew Luchak 
Webmaster
Kaydara Inc. 
[EMAIL PROTECTED]


-Original Message-
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 1:00 PM
To: Matthew Luchak; [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question


It looks like that is working, but I'm not getting a response.  I
created the XML string and set it as $xmlstring.  Then, after the fputs
that you provided below (except with the URL I'm sending to) I have:
fputs($fp, $xmlstring);

Then, to receive the response I enter:
$RetValue=fgets($w_socket, );
echo $RetValue;

I am not getting any response, so I have no idea if my XML string is
accepted, rejected or what.  Is this the right way for me to get the
response?  After I send the XML string, they will send me back some info
that will let me know if the transaction is accepted.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] fsockopen question

2001-04-26 Thread Michael Conley

It looks like that is working, but I'm not getting a response.  I created
the XML string and set it as $xmlstring.  Then, after the fputs that you
provided below (except with the URL I'm sending to) I have:
fputs($fp, $xmlstring);

Then, to receive the response I enter:
$RetValue=fgets($w_socket, 4096);
echo $RetValue;

I am not getting any response, so I have no idea if my XML string is
accepted, rejected or what.  Is this the right way for me to get the
response?  After I send the XML string, they will send me back some info
that will let me know if the transaction is accepted.

-Original Message-
From: Matthew Luchak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 10:04 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question


I use:

$fp = fsockopen(www.somewhere.com,80); 
fputs($fp, GET http://www.somewhere.com/somedir/somepage.html
HTTP/1.0\r\n\r\n);

to parse.  Should be easily modified

 
Matthew Luchak 
Webmaster
Kaydara Inc. 
[EMAIL PROTECTED]


-Original Message-
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 12:37 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] fsockopen question



How do I send the XML string to the above URL?  When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com).  I don't even really see where to force this to go
over
HTTPS.  I set the port to 443, but need to be sure that the data going
across uses SSL.

How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.asp?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] fsockopen question

2001-04-26 Thread Nuno Silva


Hi,

the way i would do it looks like this:

- setup stunnel (www.stunnel.org) to listen to port 10443 in the 
127.0.0.1 interface and forward that to www.myprovider.com
- the php script would connect to 127.0.0.1:10443 using plain text
- that's it, easy and clean! :)

stunnel will hapilly forward the 127.0.0.1:10443 to the destination 
encripted and you will have to deal with the easy part of it! ;)

Regards,
Nuno Silva



Michael Conley wrote:

 I am looking to process credit card transactions on my site.  In order to do
 this, I need to open a socket to a particular URL.  I then submit an XML
 string to them.  They process the string and send me a response.
 
 I am going to a certain (secure) location on the site of my credit card
 processor (https://www.myprovider.com/XMLSubmit/processtrans.asp) and then
 submit the XML string.  After I submit all of the XML, the processor will
 give me a response as to whether or not the transaction is approved.
 
 How do I send the XML string to the above URL?  When I use fsockopen, it
 doesn't like anything other than an IP address or a host name (ie
 www.myprovider.com).  I don't even really see where to force this to go over
 HTTPS.  I set the port to 443, but need to be sure that the data going
 across uses SSL.
 
 How do I send this XML string over HTTPS to
 https://www.myprovider.com/XMLSubmit/processtrans.asp?
 
 
 
 attachment.txt
 
 Content-Type:
 
 text/plain


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]