Jump to content

Archived

This topic is now archived and is closed to further replies.

Hamlets666

Open Url With Proxy

Recommended Posts

There it is :
[code]<?php
$url = "http://blabla.com";
$x = 0;
$proxy=@file("zz.txt");
foreach($proxy as $v) list($ips[], $ports[]) = explode(':', $v);
//
while($x < 129) { //// There are 130 proxy`s
$x = $x + 1;
$fp = fsockopen($ips[$x], $ports[$x]);
fputs($fp, "GET $url HTTP/1.0\r\nHost: $ips[$x]\r\n\r\n");
while(!feof($fp)){
  $line = fgets($fp, 4000);
  print($line);
}
fclose($fp);
}
?>[/code]

And error : [i]Warning: fsockopen() expects parameter 2 to be long, string given in z:\home\localhost\www\anti2\xy.php on line 8

Warning: fputs(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 9

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\anti2\xy.php on line 11[/i]
.......

Any idea why so? Proxy`s in zz.txt are like [b]33.33.33.33:33[/b]


By the way : when i was writing : [code]<?php
$proxy = "33.33.33.33";
$port = 33;
$url = "http://blabla.com";
$fp = fsockopen($proxy, $port);
fputs($fp, "GET $url HTTP/1.0\r\nHost: $proxy\r\n\r\n");
while(!feof($fp)){
  $line = fgets($fp, 4000);
  print($line);
}
fclose($fp);
?>[/code]
it was ok   :-\

Share this post


Link to post
Share on other sites
Try this [code]<?php
$url = "http://blabla.com";
$proxies = @file("zz.txt");

foreach($proxies as $proxy)
{
list($ip,$port) = explode(':',$v);
$fp = fsockopen($ip,$port);
fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n");
while(!feof($fp))
{
echo fgets($fp, 4000);
}
fclose($fp);
}
?>[/code]

And quit spamming.

Share this post


Link to post
Share on other sites
[code]
foreach($proxy as $v) list($ips[], $ports[]) = explode(':', $v);
[/code]

It could be that there is a blank entry in the ports array

try this check
[code]
echo '<pre>', print_r($ports, true), '</pre>';
[/code]

Share this post


Link to post
Share on other sites
I wanted to delete a post that I made a couple of days ago. How does one do this? I didn't think that it was an option so I had to settle for erasing the post.  ???

Share this post


Link to post
Share on other sites
It's a moderator-only option.

Having had their question answered, people were removing the posts, thus removing from the archive info that would be useful to others with a similar problem.

Share this post


Link to post
Share on other sites
PS file() function leaves linefeeds on the end which could also be screwing things up.

try
[code]<?php

foreach($proxy as $v) list($ips[], $ports[]) = explode(':', trim($v));

?>
[/code]

Share this post


Link to post
Share on other sites
Sorry about "spamming"  :)

[code]<?php
$url = "http://blabla.com";
$proxies = @file("zz.txt");

foreach($proxies as $v)
{
list($ip[], $port[]) = explode(':', trim($v));
$fp = fsockopen($ip,$port);
fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n");
while(!feof($fp))
{
echo fgets($fp, 4000);
}
fclose($fp);
}
?>[/code]

It`s last what I tried :) But again : [i]Warning: fsockopen() expects parameter 1 to be string, array given in z:\home\localhost\www\777\newww.php on line 8

Warning: fputs(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 9

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 12

Warning: feof(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 10

Warning: fgets(): supplied argument is not a valid stream resource in z:\home\localhost\www\777\newww.php on line 12[/i]
And error with line10,12 repeats a lot  :-[

Share this post


Link to post
Share on other sites
Try this: [code]<?php
$url = "http://blabla.com";
$proxies = @file("zz.txt");

foreach($proxies as $v)
{
list($ip, $port) = explode(':', trim($v));
$fp = fsockopen($ip,$port);
fputs($fp,"GET $url HTTP/1.0\r\nHost: $ip\r\n\r\n");
while(!feof($fp))
{
echo fgets($fp, 4000);
}
fclose($fp);
}
?>[/code]

Share this post


Link to post
Share on other sites
Daniel0, ok :) Look`s like it worked ;)


But how about if $url = bla.com/folder/?666 how to send this ?666 with get ? Will it work if write just $url = bla.com/folder/?666 ? How do you all think?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.