Page 1 of 1
how do they do it?
Posted: Fri Nov 25, 2005 11:00 am
by eugene2006
http://nntime.com/realtime/
i want to do the same I have lets say
200 socks proxies and all i get is long long wait until my @fsockopen script finishes "for" loop...
how to show real time proccess of socks cheking?
Posted: Fri Nov 25, 2005 11:17 am
by Grim...
I smell AJAX. Do a search for it on this forum.
Posted: Fri Nov 25, 2005 11:24 am
by foobar
...or go straight to the beginner's
AJAX Tutorial on devMoz.
Posted: Fri Nov 25, 2005 12:46 pm
by josh
Actually it looks like they're just using plain html output and flushing the output buffer, I don't see any hints of AJAX in the page source.
Posted: Fri Nov 25, 2005 12:57 pm
by RobertPaul
I'm with jshpro2 ... there's no JS on the pages, besides that for the ads.
Posted: Fri Nov 25, 2005 3:12 pm
by eugene2006
jshpro2 wrote:Actually it looks like they're just using plain html output and flushing the output buffer, I don't see any hints of AJAX in the page source.
excuse me, guys, but could you explain it to me how to do it?
i do echo in for loop but no echoes are shown until for loop completely finishes
lets say i have 60 socks proxies to check (fsockopen is timeout 2 seconds) it takes me about 20 seconds to wait and then only html page appreas with a result. but if i would have 2000 socks proxies? it will take ages to load, but i think i wont even get a result because of script execution time out.
so how to check step by step and not to overload server
and how to output real time progress?
please show me an example

Posted: Fri Nov 25, 2005 3:34 pm
by eugene2006
Posted: Fri Nov 25, 2005 4:13 pm
by eugene2006
Jcart | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Code: Select all
for ($x=0;$x<$numsockets;$x++)
{
ob_end_flush();
$urlInfo[$x] = parse_url($sockets[$x]);
echo $urlInfo[$x][host].":".$urlInfo[$x][port];
$sockets[$x] = @fsockopen($urlInfo[$x][host], $urlInfo[$x][port],$errno, $errstr, 1);
}
guys does this script works one sockset by one? or it is multythreaded?
is there a way to speed it up?
Jcart | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Posted: Fri Nov 25, 2005 4:16 pm
by foobar
eugene2006 wrote:guys thank yoy so much for flushing me

Bwahaha!!! Quote of the year!

Posted: Fri Nov 25, 2005 4:33 pm
by John Cartwright
guys does this script works one sockset by one? or it is multythreaded?
One by one. PHP is a single threaded.
Posted: Fri Nov 25, 2005 7:33 pm
by eugene2006
one by one is bad. how do i something like multithread or is there another way to speed up my script?
Posted: Fri Nov 25, 2005 7:52 pm
by josh
Not even sure but you could write shell scripts to return the status of a proxy, and call them one by one from exec(). You would have to set the shell scripts to write to a file somewhere and get PHP to not block while waiting for the shell script to run. You'd then gather the info from all the files.
Posted: Sat Nov 26, 2005 5:11 am
by eugene2006
sounds complicated

and not sure hosting gives a shell
Posted: Sat Nov 26, 2005 11:14 am
by josh
You wouldn't need a shell account, if you can put a php file onto your site you can put a shell script on.
You can write shell scripts in php and call them from other php scripts with exec(), wether or not your host has disabled exec() is the issue