Jump to content

Search the Community

Showing results for tags 'web proxy'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 2 results

  1. Fellow Php'ers, I'm a php learner. Beginner. Very enthusiastic enough to try to build my own web proxy. See how far I have reached. The following is cURL. It shows you a ui text box where you type a url and cURL would fetch that url. 1. Now, in that fetched url, there could be links like so: <a href="http://www.google.com">Google</a> <a href="http://yahoo.com">Yahoo</a> This script is supposed to precede 'proxified_page_test.php?url_to_proxify=' on all links. So now, the links present on the proxified page (cURL fetched page) should look like this: <a href="proxified_page_test.php?url_to_proxify=http://www.google.com">Google</a> <a href="proxified_page_test.php?url_to_proxify=http://yahoo.com">Yahoo</a> 2. Also, in that fetched url, there could be a search box, like the google search box. Search box containing search box code like so ... "....action = http://google.com/q?" Again, this script is supposed to precede 'proxified_page_test.php?url_to_proxify=' on all links including on those forms that forward you to their processor.php. So now, the links present on the proxified page (cURL fetched page) should look like this: "....action = proxified_page_test.php?url_to_proxify=http://google.com/q?" That way, if you do a search on the proxified page then the SERPs presented would contain links where proxified_page_test.php?url_to_proxify= have been added. That way, if you were viewing google and doing a search, the SERPs presented would list links that precede the "proxified_page_test.php?url_to_proxify=" so that the result links can also be proxified when clicked. ISSUE Problem is, if you type "http://www.google.com" then it does not fetch that page. What is hindering the fetch ? <?php /* ERROR HANDLING */ declare(strict_types=1); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL); /* STEP 2: The IF gets triggered as soon as the "submit" button is clicked in the ui text box labeled: Url Following IF code deals with GET method. */ if(isset($_GET["url_to_proxify"]) === TRUE) { echo "IF got triggered!"; $url_to_proxify = filter_input(INPUT_GET, 'url_to_proxify', FILTER_VALIDATE_URL); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "$url_to_proxify"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_HEADER, 5); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $curl_result = curl_exec($ch); $domain = parse_url($url_to_proxify, PHP_URL_HOST); echo var_dump($domain); //Add proxy link on all links present on proxified page $pattern = array("http://", "https://", "http://www.", "https://www.", "localhost"); $replace = array("proxified_page_test.php?url_to_proxify=http://\".$domain\"", "proxified_page_test.php?url_to_proxify=https://\".$domain\"", "proxified_page_test.php?url_to_proxify=http://www.\".$domain\"", "proxified_page_test.php?url_to_proxify=https://www.\".$domain\"", "proxified_page_test.php?url_to_proxify=http://www.\".$domain\""); $string_replaced_data = str_replace($pattern, $replace, $curl_result); echo var_dump($string_replaced_data); //Add proxy link on all Image Links (Eg. Google Img File) $pattern = array('src="', 'src = "', 'src= "', 'src ="', "src='", "src = '", "src= '", "src='"); $replace = array('src="proxified_page_test.php?url_to_proxify=\".$domain\""', 'src = "proxified_page_test.php?url_to_proxify=\".$domain\""', 'src= "proxified_page_test.php?url_to_proxify=\".$domain\""', 'src ="proxified_page_test.php?url_to_proxify=\".$domain\""', "src='proxified_page_test.php?url_to_proxify=\".$domain\"'", "src = 'proxified_page_test.php?url_to_proxify=\".$domain\"'", "src= 'proxified_page_test.php?url_to_proxify=\".$domain\"'", "src ='proxified_page_test.php?url_to_proxify=\".$domain\"'"); $string_replaced_data = str_replace($pattern, $replace, $curl_result); echo var_dump($string_replaced_data); //Add proxy link on all links presented by the searchengine result pages (SERPS). Eg. Google Search Pages (SERPs) $pattern = array('action="', 'action = "', 'action= "', 'action ="', "action='", "action = '", "action= '", "action='"); $replace = array('action="proxified_page_test.php?url_to_proxify=\".$domain\""', 'action = "proxified_page_test.php?url_to_proxify=\".$domain\""', 'action= "proxified_page_test.php?url_to_proxify=\".$domain\""', 'action ="proxified_page_test.php?url_to_proxify=\".$domain\""', "action='proxified_page_test.php?url_to_proxify=\".$domain\"'", "action = 'proxified_page_test.php?url_to_proxify=\".$domain\"'", "action= 'proxified_page_test.php?url_to_proxify=\".$domain\"'", "action ='proxified_page_test.php?url_to_proxify=\".$domain\"'"); $string_replaced_data = str_replace($pattern, $replace, $curl_result); echo var_dump($string_replaced_data); print_r($curl_result); curl_close($ch); } else { echo "ELSE got triggered!"; //Html Form ?> <html> <body> <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET"> Url: <input type = "text" name = "url_to_proxify" /> <input type = "submit" /> </form> </body> </html> <?php } ?>
  2. Php Gurus, I am trying to add a tracker onto a web proxy. A web proxy like: http://anonymouse.org/cgi-bin/anon-www.cgi/http://forums.phpfreaks.com I am currently using miniProxy on my local host. Now, I want to add it to my website. And log what my users (family) view. Let us assume mymydomain.com is my domain. Now, my proxy's homepage would be this: http://mymydomain.com/mini-proxy/index.php And, the proxified pages url format would look like this: http://mymydomain.com/mini-proxy/index.php?https://www.google.com Actually, here is a site using the miniProxy php script. You may check it out: https://miniproxy-php.appspot.com/index.php? You know what I mean. You know how a web proxy and it's proxified page's url format comes as. Now, what I want to do is add my tracker url onto all proxified links. Like so: http://mymydomain.com/mini-proxy/URL_TRACKER.PHP?DESTINATIONURL Example: http://mymydomain.com/mini-proxy/url_tracker.php?https://www.google.com Since miniProxy is a one page script, I know that I have to add the required php code (logging code) at the top of the script. And the tracker should use the GET method to grab the DESTINATION URL and log the DESTINATION URL onto the mysql tbl before forwarding the user to the DESTINATION. Now, at this instant, I know how to add links onto mysql tbl. II know how to write the logging code. But, as of now, I just need your skillful help to find the right variable that deals with the destination url as I am at a little loss here. I need to identify the variable that holds the destination url. That way, I can just precede "url_tracker.php?" before the value (destination url) of the variable. And, rename the single file to "url_tracker.php". So now, every proxified page would show links not as: http://mymydomain.com/mini-proxy/index.php?https://www.DESTINATIONURL.com But as: http://mymydomain.com/mini-proxy/url_tracker.php?https://www.site1.com http://mymydomain.com/mini-proxy/url_tracker.php?https://www.site2.com And so on. I am trying to finish this project that has come to a stand-still (it seems) over there for a few months: https://www.daniweb.com/programming/web-development/threads/508632/where-to-precede-the-tracking-url I am mentioning this link so you don't repeat yourself that has already been mentioned there. Here, let us continue from where they have LEFT-OFF over there. It seems they have failed to fix the "over logging issue". Let us see if we can fair better here than what they did over there. Anyway, it seems the solution provided over there, by a user called Cereal, did half the job. His solution made miniProxy log the destination url or the url that got clicked alright but the hiccup was that, it also started logging every link (including imgs, banners, etc.) present on the proxified page. Those should not be logged. So, let us say, you are viewing the google homepage via the miniProxy. In this case, the google homepage's link should be logged onto the MySql Db and not all the links present on the google homepage such as the google icon img link, google contactus link etc. Any ideas how to fix this ? Any code sample provided would be most appreciated. Remember: 1. I need to know on which line on the miniProxy script to add my tracker url. On which variable's value. 2. Only the clicked url must be logged and not all links present on the proxified page that you clicked over to. NOTE: If miniProxy is going to be too complicated to sort the issue of it to not log all links present on the proxified page then would it be easier to add the tracking url onto Php-Proxy instead ? https://www.php-proxy.com/ However, Php-Proxy it seems, is not a one page script. And that might be tedious to work with. If you have any better free, open source web proxy script that would be easier to deal with for this project then say so. This is an interesting project and a good learning curve for a php beginner. Thanks!
  • Create New...

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.