Jump to content


Photo

Open Url With Proxy


  • Please log in to reply
11 replies to this topic

#1 Hamlets666

Hamlets666
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 24 October 2006 - 12:11 PM

There it is :
<?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);
}
?>

And error : 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

.......

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


By the way : when i was writing :
<?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);
?>
it was ok   :-\

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 28 October 2006 - 09:08 AM

Try this
<?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);
}
?>

And quit spamming.

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 28 October 2006 - 09:18 AM

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

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

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

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 28 October 2006 - 09:19 AM

@Daniel

I wouldn't call a "bump" every couple of days "spamming"
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 28 October 2006 - 09:30 AM

Well ok... they could still be deleted now...

#6 php_joe

php_joe
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 28 October 2006 - 09:40 AM

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.  ???
[url=http://darkswordsguide.com][/url]

#7 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 28 October 2006 - 09:48 AM

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.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#8 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 28 October 2006 - 10:38 AM

PS file() function leaves linefeeds on the end which could also be screwing things up.

try
<?php

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

?>

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#9 Hamlets666

Hamlets666
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 28 October 2006 - 03:41 PM

Sorry about "spamming"  :)

<?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);
}
?>

It`s last what I tried :) But again : 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

And error with line10,12 repeats a lot  :-[

#10 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 28 October 2006 - 05:51 PM

Did you check for blanks as I suggested earlier
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#11 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 28 October 2006 - 05:52 PM

Try this:
<?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);
}
?>


#12 Hamlets666

Hamlets666
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 29 October 2006 - 03:55 PM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users