php-windows Digest 10 May 2004 23:18:34 -0000 Issue 2245
Topics (messages 23654 through 23663):
Re: How did you realised an asyncron job
23654 by: Svensson, B.A.T. (HKG)
Re: How to check port conection? socket_connect and fsockopen have problems
23655 by: Sherry
23657 by: Gryffyn, Trevor
23658 by: Svensson, B.A.T. (HKG)
23660 by: Sherry
23661 by: Sherry
23662 by: Svensson, B.A.T. (HKG)
23663 by: Sherry
Re: Is this possible
23656 by: George Pitcher
working on phpnuke - submit topics module, need help on File upload
23659 by: Exiang
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
%man sh
hints: &, fork()
-----Original Message-----
From: [EMAIL PROTECTED]
To: Svensson, B.A.T. (HKG)
Sent: 10-5-2004 15:34
Subject: How did you realised an asyncron job
Reply-To: [EMAIL PROTECTED]
I am trying to start on LInux an asyncron job.
Here is how I tryed and it didn't worked:
$proces=sprintf('wget '.
'"%sbackground.php?payee=%s&file=%s&type=profile"',
$SITE_BASE, $HTTP_SESSION_VARS['payeeID'],
$file);
$fp=popen($proces, "r");
print "Forking process: $proces";
exit;
Any suggestions?
I would really apreciate the help.
Sabin Posea
--- End Message ---
--- Begin Message ---
I don't need 1000 times at once...
But I want to check ports periodically...
For example, every 2 minutes I must check 10 ports... So 1000 times * 2 / 10
= 200 minutes = only 3 hours... :(
So, in one week, I'll have 7*24*60*10/2=50 000 connection in LISTENING
state!
To close these connection, I have to restart apache service... :(
Best regards,
Sherry.
"B.A.T. Svensson" <[EMAIL PROTECTED]>
> Why do you need to call a socket 1000 times in order
> to find out if a service is available or not?
--- End Message ---
--- Begin Message ---
Well, two things come immediately to mind. Using sleep() or
continuously cycling and checking to see if the current time matches
whatever time criteria you need (8:00am, minutes divisible by 10, etc).
Then you don't need to hammer the sockets 1000+ times per second.
-TG
> -----Original Message-----
> From: Sherry [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 10, 2004 9:59 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] How to check port conection?
> socket_connect and fsockopen have problems
>
>
> I don't need 1000 times at once...
> But I want to check ports periodically...
> For example, every 2 minutes I must check 10 ports... So 1000
> times * 2 / 10
> = 200 minutes = only 3 hours... :(
> So, in one week, I'll have 7*24*60*10/2=50 000 connection in LISTENING
> state!
> To close these connection, I have to restart apache service... :(
>
> Best regards,
> Sherry.
>
> "B.A.T. Svensson" <[EMAIL PROTECTED]>
> > Why do you need to call a socket 1000 times in order
> > to find out if a service is available or not?
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Ok, I see the nature of the problem now.
You probably get all these SYNC_SENT and TIME_WAIT because
the hand shake is not properly done between the machines.
SYNC_SENT means that the local socket is trying to
established a connection.
TIME_WAIT indicates that no shutdown is (yet) recived
from the other end.
(This how is the classical SYNC-attack works, i.e.
open a port on the remote machine, and drop the
connection without picking up the SYNC_SENT pakages,
leaving the remote server port in TIME_WAIT - this way
one can "eat up" all ports on a remote machine.)
In these cases it very useful to have a look at the socket
state at the remote peer to determine weather the sync
package was received or not.
Firewalls can sometimes screw up this kind of traffic,
and drop SYNC packages in both direction without no good
reason - the firewall log may complain that the package
"looks like" it was forged, but in fact it is just fine.
-----Original Message-----
From: Sherry
To: [EMAIL PROTECTED]
Sent: 10-5-2004 15:59
Subject: Re: [PHP-WIN] How to check port conection? socket_connect and
fsockopen have problems
I don't need 1000 times at once...
But I want to check ports periodically...
For example, every 2 minutes I must check 10 ports... So 1000 times * 2
/ 10
= 200 minutes = only 3 hours... :(
So, in one week, I'll have 7*24*60*10/2=50 000 connection in LISTENING
state!
To close these connection, I have to restart apache service... :(
Best regards,
Sherry.
"B.A.T. Svensson" <[EMAIL PROTECTED]>
> Why do you need to call a socket 1000 times in order
> to find out if a service is available or not?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Errr...
I have so bad English??? :)
I doesn't mean 1000 times per second!
I mean 10 times per 2 minutes... So, in 3 hours I'll have about 1000 open
connections!
And the main problem is these opened connections...
Best regards,
Sherry.
>"Trevor Gryffyn" <[EMAIL PROTECTED]> ???????/???????? ? ????????
?????????:
>news:[EMAIL PROTECTED]
..
>Well, two things come immediately to mind. Using sleep() or
>continuously cycling and checking to see if the current time matches
>whatever time criteria you need (8:00am, minutes divisible by 10, etc).
>Then you don't need to hammer the sockets 1000+ times per second.
>-TG
--- End Message ---
--- Begin Message ---
BAT, I have tried fsockopen and socket_connect on two machines.
First comp has Kerio firewall, and second hasn't any firewall.
Problem persists on each machine.
And I can't look at remote socket... Comp on other end just doesn't exist...
:)
After timeout (when using fsockopen) SYNC_SENT connection closes normally,
but LISTENING connection remains.
Best regards,
Sherry.
"B.A.T. Svensson" <[EMAIL PROTECTED]> �������/�������� � ��������
���������: news:[EMAIL PROTECTED]
> Ok, I see the nature of the problem now.
>
> You probably get all these SYNC_SENT and TIME_WAIT because
> the hand shake is not properly done between the machines.
>
> SYNC_SENT means that the local socket is trying to
> established a connection.
>
> TIME_WAIT indicates that no shutdown is (yet) recived
> from the other end.
>
> (This how is the classical SYNC-attack works, i.e.
> open a port on the remote machine, and drop the
> connection without picking up the SYNC_SENT pakages,
> leaving the remote server port in TIME_WAIT - this way
> one can "eat up" all ports on a remote machine.)
>
> In these cases it very useful to have a look at the socket
> state at the remote peer to determine weather the sync
> package was received or not.
>
>
> Firewalls can sometimes screw up this kind of traffic,
> and drop SYNC packages in both direction without no good
> reason - the firewall log may complain that the package
> "looks like" it was forged, but in fact it is just fine.
--- End Message ---
--- Begin Message ---
LISTNING is the state a server (listner) normally
should be in, or do I miss something here?
That you can replicate it on anotehr machines, does not
say that very much. It can still be 1) the network, 2)
wrong handling of sockets in the program, 3) something
else.
I guess I need to have a closer look at your first mail
again to better understadn the problem, but right now I
am bit sleepy so that will have to wait until tomorrow.
-----Original Message-----
From: Sherry
To: [EMAIL PROTECTED]
Sent: 10-5-2004 19:44
Subject: Re: [PHP-WIN] How to check port conection? socket_connect and
fsockopen have problems
BAT, I have tried fsockopen and socket_connect on two machines.
First comp has Kerio firewall, and second hasn't any firewall.
Problem persists on each machine.
And I can't look at remote socket... Comp on other end just doesn't
exist...:)
After timeout (when using fsockopen) SYNC_SENT connection closes
normally, but LISTENING connection remains.
Best regards,
Sherry.
"B.A.T. Svensson" <[EMAIL PROTECTED]> OIIAYEI/OIIAYEIA ? II?IOONE
OIAAOAYAA:
news:[EMAIL PROTECTED]
> Ok, I see the nature of the problem now.
>
> You probably get all these SYNC_SENT and TIME_WAIT because
> the hand shake is not properly done between the machines.
>
> SYNC_SENT means that the local socket is trying to
> established a connection.
>
> TIME_WAIT indicates that no shutdown is (yet) recived
> from the other end.
>
> (This how is the classical SYNC-attack works, i.e.
> open a port on the remote machine, and drop the
> connection without picking up the SYNC_SENT pakages,
> leaving the remote server port in TIME_WAIT - this way
> one can "eat up" all ports on a remote machine.)
>
> In these cases it very useful to have a look at the socket
> state at the remote peer to determine weather the sync
> package was received or not.
>
>
> Firewalls can sometimes screw up this kind of traffic,
> and drop SYNC packages in both direction without no good
> reason - the firewall log may complain that the package
> "looks like" it was forged, but in fact it is just fine.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Heh...
I mean not LISTENING on 80 port! I mean LISTENING on each of these
connections!
For example, My IP is 192.168.18.1 and I try to check port 21 on IP
192.168.18.33.
When I call fsockopen, apache open 2(!) connections:
192.168.18.1:3256 192.168.18.1:0 LISTENING (3256 -
random port on my IP)
192.168.18.1:3256 192.168.18.33:21 SYN_SENT
When timeout occurs, second connections disappeared, but first exist until
apache restart!
And I don't do anything else! Just call fsockopen... :(
Best regargs,
Sherry.
"B.A.T. Svensson" <[EMAIL PROTECTED]> �������/�������� � ��������
���������: news:[EMAIL PROTECTED]
> LISTNING is the state a server (listner) normally
> should be in, or do I miss something here?
>
> That you can replicate it on anotehr machines, does not
> say that very much. It can still be 1) the network, 2)
> wrong handling of sockets in the program, 3) something
> else.
>
> I guess I need to have a closer look at your first mail
> again to better understadn the problem, but right now I
> am bit sleepy so that will have to wait until tomorrow.
--- End Message ---
--- Begin Message ---
Trevor,
I think I have this one licked. Not tested yet, but a little bit of
javascript and it should work like a dream.
Ta for helping me focus.
George
> -----Original Message-----
> From: Gryffyn, Trevor [mailto:[EMAIL PROTECTED]
> Sent: 7 May 2004 6:22 pm
> To: [EMAIL PROTECTED]
> Cc: George Pitcher
> Subject: RE: [PHP-WIN] Is this possible
>
>
> That's sort of what I thought you were getting at George.
>
> How's this scenario work for you:
>
> 1. User pulls up initial screen, either showing all data or no data at
> all
> --- SELECT recordid,projectid,title,genre,author,whatever FROM
> sometable
> 2. User enters parameters for recordset (ie. All records after January
> 1st, All records matching a certain ID # or other criteria). This
> returns your recordset which is a subset of everything you have in the
> database (say 5 out of 100 records all with something in common)
> --- SELECT recordid,projectid,title,genre,author,whatever FROM
> sometable WHERE readytodeliver = 'Yes'
> 3. User changes or sets the item "Delivery Date: 5/4/04" for instance
> and clicks the "Submit" button. If you ALWAYS want to change this item
> in everything in the recordset you're viewing, then pass the parameters
> for the recordset along with the changed data.
> --- UPDATE sometable SET deliverydate = '$formdeliverydate'
> WHERE readytodeliver = 'Yes'
>
>
> Of course adapting to use mysql functions in PHP and/or whatever the
> proper syntax is for your database system (forgive me, I work with
> Oracle and SQL Server and use the ADODB functions so I usually deal in
> straight SQL instead of PHP built-in database functions).
>
>
> I know you said it gets a little more complicated, but whatever your
> "WHERE" criteria are, you should be able to pass back along with the
> DeliveryDate data even if you have to hide the WHERE criteria in a
> hidden form field or a SESSION variable. Essentially this ends up
> saying "That data I just requested and looked at.. Change this field all
> to the same thing I just entered".
>
> Am I missing something or is this what you were looking for?
>
> -TG
>
>
> > George Pitcher said:
> > The Filemaker function I'm attempting to replicate is called
> > 'Replace' and it basically takes the data from the field that
> > the user has 'in focus' and sets each recordset.record's
> > equivalent field to that value, regardless of data type, so
> > it works on strings, numbers and dates.
> >
> > A typical use would be where we have searched for everything
> > that is ready to deliver to the customer and enter a delivery
> > date into each record. They aren't usually that simple, else
> > I would script it differently (as I will for the actual delivery
> > date), but I'm sure you've got my drift by now.
> >
> > Cheers
> >
> > George
>
--- End Message ---
--- Begin Message ---
I had posted the following msg at phpnuke.org but nobody reply me.
I not sure izzit suitable to post up here but i am urgently need for help.
My post:
------------------------------------------------------------------------------------------------------------------------------
I am working on a module tat allowed visitors to submit their own company logo as a
new topics and it will be approve by the admin.
I facing problem now at the logo uplaod part.
as i understand, every post variable will be automatically convert to variable with
the same name like :
<input type=\"text\" name=\"topic_text\" size=\"40\" maxlength=\"40\" >
i jsut need to call $topic_text and i will get the variable of that form field.
however, this do not work for
<input type=\"file\" name=\"topic_image\"></input>
and I already using enctype="multipart/form-data"
I tried to get with $_FILES['topic_image'] but do not work..
expert here pls HELP ME~~~!
p/s the module is for nuke version 6.9
regards,
eXiang
--- End Message ---