Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default [PHP] Random Proxy Website

    OK so this is a script that gets a URL and goes to a random proxy site.

    Example
    http://www.thomas.uk.to/proxy/proxy....ww.habbo.co.uk

    There are two files, proxy.php and database.txt

    Database.txt is where the list of proxies is. Heres whats in mine:

    Code:
    http://www.proxygen.info/cgiproxy/nph-proxy.pl/010110A/http/<URL>/
    http://www.restfull.info/v2/index.php?q=<URL>&hl=0
    http://www.bbrowse.com/nph-maths.pl/000010A/http/<URL>/
    Note that in the URL's theres a certain code: <URL>
    The PHP replaces <URL> with teh given URL and goes to it.

    Heres the proxy.php

    PHP Code:
    <?php
    function proxy($urlget){
    $urlget eregi_replace("http://"""$urlget);
    $url urldecode($urlget);

    $database fopen("database.txt""rb");

    while(!
    feof($database)){
        
    $line fgets($database);
        
    $data[] .= $line;
    }

    $lastline count($data) - 1;

    $random rand(0$lastline);
    $randomproxy $data[$random];

    $proxy eregi_replace('<URL>'$url$randomproxy);

    header("Location: $proxy");

    fclose($database);

    }
    ?>
    You would use it like this:

    PHP Code:
    <?php
    include('proxy.php);
    proxy("www.habbo.co.uk");
    ?>
    Proxies can be added to the database, you just need the URL of a page.

    E.g.

    http://myproxy.com/proxy/index.php?q=www.website.com

    you would put

    http://myproxy.com/proxy/index.php?q=<URL>

    in the database.txt file.

    If you do not understand, reply or PM me.
    Last edited by ZAG; 16-02-2007 at 09:08 PM.

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  2. #2
    Join Date
    Dec 2006
    Location
    None of your business!
    Posts
    2,492
    Tokens
    50

    Latest Awards:

    Default

    Thats quite good I like it + rep

  3. #3
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    Well I thought it could be useful.

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  4. #4
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Well my first trial of your exsample gave a page telling me that the proxie site blocked remote requests hence didnt work to well o.0 Also i dont see why you would want this as opposed to just chooseing a proxie and useing it, since that way you know which ones have been blocked and which havent, makeing it less luck of the draw.

    Also as opposed to messing around with a while loop, why not just use the file command to do all that for you?
    $database = fopen("database.txt", "rb");

    while(!feof($database)){
    $line = fgets($database);
    $data[] .= $line;
    }
    ==
    $data = file("database.txt");

  5. #5
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    Quote Originally Posted by 01101101entor View Post
    Well my first trial of your exsample gave a page telling me that the proxie site blocked remote requests hence didnt work to well o.0
    Well the example proxies are ones I've just found looking around the forum.

    Quote Originally Posted by 01101101entor View Post
    Also i dont see why you would want this as opposed to just chooseing a proxie and useing it, since that way you know which ones have been blocked and which havent, makeing it less luck of the draw.
    Because picking out of a big database would give you more chance to find an unblocked one. Because the single one might be blocked.

    Quote Originally Posted by 01101101entor View Post
    Also as opposed to messing around with a while loop, why not just use the file command to do all that for you?
    Thanks

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •