PHP Tutorials: Basic PHP Proxy

August 27th, 2010 by admin

Create your own basic php HTTP proxy. Remember, a proxy should not be used for illegal activity. This tutorial will cover the simplicity of creating a proxy using PHP, and does not encourage such illegal activity.

Posted in Proxy | 21 Comments »

21 Responses

  1. Hyp3rThrust Says:

    Wow! Nice work mate! I love your work. You are really good at PHP and HTML.

  2. crazynoob11 Says:

    You might come across a bunch of problems using this btw. Such as, if the image used the direct URL, or if it said <img width=" first instead. Probably a few other things can go wrong, but yea… Still good. Although I'm having problems with it… I made a file on my site that said : test.php just to test this out, then I added the exact code you put in the beginning, yet nothing is loading.

  3. djsufferthing Says:

    To get the images to load, as stated previously, is to replace <img src=" with just replacing src=" in your script. Works for me. You need to use some more tricks to stay proxied when visiting links on the proxied page. Otherwise only the first page will be requested from your server. Good luck and never use this to do TOS violation or any other illegallities.

  4. TheGnarlyy Says:

    This is still using the client to load the images, therefore not acting as a proxy. All this does is rename the URL. So your IP still shows up to the server.

  5. goliathlup1 Says:

    Pretty cool and to the point tutorials. I have a quenstion. I have been trying to make a very simple searchbot thing in PHP for a couple of hours, do you know what the function file() returns if it is not successful or a way to check that does not change the parameters?

  6. goliathlup1 Says:

    Pretty cool and to the point tutorials. I have a quenstion. I have been trying to make a very simple searchbot thing in PHP for a couple of hours, do you know what the function file() returns if it is not successful or a way to check that does not change the parameters?

  7. computertrick Says:

    @ThePladds that was the correct php follow the tutorial correctly and you will see….

  8. ThePladds Says:

    this is extremely frustrating. it does not work. the image fails. anyone know the correct php for it to work.

  9. kaptinook Says:

    ha ha! I have it. Alex your stuff is brilliant but I couldn’t get the proxy to work, which really bugged me. So I left it for a couple of days, came back and looked at google’s code. Img src = does not appear together so what I found was I had to replace just the words $part = str_ireplace(‘src=”‘,’src=”‘.$url,$part);
    And it worked. Just thought i’d share it. Keep the tutorials coming they are fantastic!

  10. spadict Says:

    You could be fixing up the page script on your side to send something bogus back. Web pages are at risk of all sorts of command injection that could do things a regular end user isn’t supposed to do

  11. jameswx09 Says:

    Doesn’t work for images.

  12. Acebeats1 Says:

    Will this proxy rotate multiple IP addresses?

  13. wideload123 Says:

    ereg_replace is for regular expression replacing…

    you should just use str_replace for what you do … ??

  14. tecnophobia Says:

    You naughty boy !!! hahaha

  15. ti07shadow Says:

    abuse of proxies or use of a proxy in terms when you hack a site or w/e just read the terms and agreement of proxy sites. using a proxy illegally is a federal offense. just visit a proxy site and read their terms.

  16. millan112 Says:

    how can it be used illegally?

  17. ZepplinProgramming Says:

    Really great tutorial, why don’t you consider applying for Youtube partnership, your videos are great and you have quite a lot of subscribers.

  18. EpicHaloMoments Says:

    Good tutorial! I need help though :( . I can search fine but the image still does not show up. When I view the selection source it shows up as <img alt "Google" then src= whatever. I made my img line the same as yours, but it doesn't seem to work.
    Any help would be greatly appreciated.
    Thanks.

  19. EpicHaloMoments Says:

    Good tutorial but i need help. I can search fine but the image does not show up. When i view the selection source it shows up as <image alt "Google" then source= as whatever.
    Any help would be greatly appreciated.

  20. omanoman98 Says:

    My God, you are just the best of the best Alex…
    Thank youuuuuuuu very much for this fabulous tutorial =}
    Just to expand on this: how does creating a proxy for a website help you as a user? Is just for fast retrieval? And if it does help improve security, then how?

  21. KoolKid417 Says:

    Something for another tutorial could be to use cURL.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.