PHP Tutorials: Basic PHP Proxy

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.

Both comments and pings are currently closed.

18 Responses to “PHP Tutorials: Basic PHP Proxy”

  1. KoolKid417 says:

    Something for another tutorial could be to use cURL.

  2. 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?

  3. 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.

  4. 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.

  5. millan112 says:

    how can it be used illegally?

  6. 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.

  7. tecnophobia says:

    You naughty boy !!! hahaha

  8. wideload123 says:

    ereg_replace is for regular expression replacing…

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

  9. Acebeats1 says:

    Will this proxy rotate multiple IP addresses?

  10. jameswx09 says:

    Doesn’t work for images.

  11. 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

  12. 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!

  13. ThePladds says:

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

  14. computertrick says:

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

  15. 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?

  16. 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?

  17. 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.

  18. 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.