Jump to content

Archived

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

buraisu

Connecting to proxy servers

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Just connect to the proxy instead. I don't know how proxies work, so I cannot specify it more detailed.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote author=buraisu link=topic=112089.msg454873#msg454873 date=1161340338]
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$.
[/quote]

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

Share this post


Link to post
Share on other sites
I am having a hard time believing that they allow the usage bots to get fake hits.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I think you're possibly going to need the [url=http://uk.php.net/manual/en/ref.curl.php]cURL[/url] library.

Regards
Huggie

Share this post


Link to post
Share on other sites
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?


[code]
<?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++;
}

?>
[/code]

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.