Jump to content


Photo

Connecting to proxy servers


  • Please log in to reply
8 replies to this topic

#1 buraisu

buraisu
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 20 October 2006 - 05:12 AM

Hi there.
Is it possible to connect to a site (lets say we are using fopen)
but connect thorugh a proxy server.

Can this be done all in php?

#2 Daniel0

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

Posted 20 October 2006 - 07:01 AM

Just connect to the proxy instead. I don't know how proxies work, so I cannot specify it more detailed.

#3 buraisu

buraisu
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 20 October 2006 - 10:32 AM

Well, this may sound lame, but if I can find a way to get my friends nexopia profile hitcount up by a certain amount I am oing to get 50$.

I know that a hit is added for every different ip address that visits the page, once a day.


So I am trying to make a script that will connect to different proxy servers in a databse and give the page a hit.

#4 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 20 October 2006 - 10:35 AM

Well, this may sound lame, but if I can find a way to get my friends nexopia profile hitcount up by a certain amount I am oing to get 50$.


I don't think it's lame, I like someone who shows initiative when finding solutions.

Many people who post here are trying to find solutions to code problems that they themselves are charging customers for.  I'm also sure that they're charging a hell of a lot more than $50 ;D

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#5 Daniel0

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

Posted 20 October 2006 - 10:37 AM

I am having a hard time believing that they allow the usage bots to get fake hits.

#6 buraisu

buraisu
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 20 October 2006 - 10:51 AM

I can do it if I manually change my proxy settings no problem.
but that is rather annoying.

I am just connecting to the page with a different IP address, therefore they think I am a different browser.

I just want to be able to automate this process with PHP.

#7 buraisu

buraisu
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 20 October 2006 - 11:11 AM

Here is a better description of what I need to do.

In a loop.
Connect to proxy server pulled from a database,
give the webpage a hit
repeate for other proxy servers.

It shouldn't be a big task, unless it is a difficult process (if it is even possible) to do the proxy server stuff.

#8 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 20 October 2006 - 01:37 PM

I think you're possibly going to need the cURL library.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#9 buraisu

buraisu
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 21 October 2006 - 10:56 PM

I wrote this script using the curl information I read up on.
but it doesnt really work.

Is it becuase I am using the loop?
can this even be done how I am trying to do it
or must I do it another way?


<?php

include 'db.php';

$query = 'SELECT url FROM proxies';
$result = mysql_query($query);
$ii = mysql_num_rows($result);

$i=0;
while ($i < $ii) {
	$prox = mysql_result($result,$i,"url");
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, "http://targeturl");
	curl_setopt($ch, CURLOPT_PROXY, "$prox");
	curl_exec($ch);	
	curl_close($ch);
	$i++;	
}
	
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users