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 »
August 27th, 2010 at 11:55 pm
Wow! Nice work mate! I love your work. You are really good at PHP and HTML.
August 27th, 2010 at 11:55 pm
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.
August 27th, 2010 at 11:55 pm
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.
August 27th, 2010 at 11:55 pm
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.
August 27th, 2010 at 11:55 pm
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?
August 27th, 2010 at 11:55 pm
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?
August 27th, 2010 at 11:55 pm
@ThePladds that was the correct php follow the tutorial correctly and you will see….
August 27th, 2010 at 11:55 pm
this is extremely frustrating. it does not work. the image fails. anyone know the correct php for it to work.
August 27th, 2010 at 11:55 pm
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!
August 27th, 2010 at 11:55 pm
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
August 27th, 2010 at 11:55 pm
Doesn’t work for images.
August 27th, 2010 at 11:55 pm
Will this proxy rotate multiple IP addresses?
August 27th, 2010 at 11:55 pm
ereg_replace is for regular expression replacing…
you should just use str_replace for what you do … ??
August 27th, 2010 at 11:55 pm
You naughty boy !!! hahaha
August 27th, 2010 at 11:55 pm
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.
August 27th, 2010 at 11:55 pm
how can it be used illegally?
August 27th, 2010 at 11:55 pm
Really great tutorial, why don’t you consider applying for Youtube partnership, your videos are great and you have quite a lot of subscribers.
August 27th, 2010 at 11:55 pm
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.
August 27th, 2010 at 11:55 pm
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.
August 27th, 2010 at 11:55 pm
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?
August 27th, 2010 at 11:55 pm
Something for another tutorial could be to use cURL.