LuisCosio.com

LuisCosio.com random header image

Add URL logging to PHProxy 0.5b2

April 24th, 2007 · 25 Comments

If you want to keep an eye on what your proxy visitors are seeing truth your proxy, just open index.php and add this:

After line 184:

function url_parse($url, & $container)

{

Add this:

$stuff = $_SERVER['REMOTE_ADDR'].”,”.$url.”\n”;
$fp = fopen(’log.txt’,”a”);
fwrite($fp,$stuff);
fclose($fp);

Now all the visited URL’s will be stored in a file called log.txt in CSV format

  • del.icio.us
  • Reddit
  • Simpy
  • blinkbits
  • BlinkList
  • Ma.gnolia
  • Slashdot
  • Digg

Tags: PHP

25 responses so far ↓

  • 1 nasser // May 19, 2007 at 6:10 pm

    ph-proxy

  • 2 Tania // May 24, 2007 at 3:08 pm

    Its Great!

  • 3 Chris // Aug 5, 2007 at 3:56 pm

    Great, thanks :D

    To log the time/date the proxy was used to visit whatever site use this (the time will ofcourse be the server time)…

    $proxytime = date(’h:i:s A’);
    $proxydate = date(’d-m-Y’);
    $stuff = $_SERVER['REMOTE_ADDR'].”,”.$url.” , “.$proxydate.” , “.$proxytime.”\n”;
    $fp = fopen(’log.txt’,”a”);
    fwrite($fp,$stuff);
    fclose($fp);

  • 4 OVGuillermo // Aug 24, 2007 at 7:40 pm

    Thank you for your site. I have found here much useful information.
    Good site ! ;)

  • 5 CoawStoossy // Sep 1, 2007 at 10:20 pm

    For most people,affordable life insurance quote falls into that category because it protects a family against a devastating loss of income.

  • 6 Jason Liquorish // Nov 4, 2007 at 11:53 am

    Hi, is it also possible to ban users, ips, keywords, hosts and such?

    Thanks

  • 7 VP // Nov 12, 2007 at 9:15 pm

    Here is code for a shell script crontab to rotate the logs and delete old ones. This avoids wasting disk space and prevents from having to manually clear the log.

    #!/bin/sh

    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export PATH

    # NOTE: Change this value to the full path of
    # the directory where the log files are contained.
    PROXYDIR=full/path/to/proxy/logs

    # Rotate the old logs
    rm -f ${PROXYDIR}/log.txt.4
    mv ${PROXYDIR}/log.txt.3 ${PROXYDIR}/log.txt.4
    mv ${PROXYDIR}/log.txt.2 ${PROXYDIR}/log.txt.3
    mv ${PROXYDIR}/log.txt ${PROXYDIR}/log.txt.2

    # Create the new log
    touch log.txt

    # Set ownership of the new log file so Apache can write to it
    chmod 666 log.txt

  • 8 Mauricio Zepeda // Dec 6, 2007 at 9:07 pm

    Se escribe ‘through’ no ‘truth’

  • 9 edgar // Dec 7, 2007 at 4:45 pm

    tell me how to unlock bebo.com

  • 10 Nijhir Lomax // Dec 14, 2007 at 4:19 pm

    please give us a code 2 see see myspace.com or Ray J And Kim Kardashian Sex tape please

  • 11 Buuster // Dec 20, 2007 at 7:47 pm

    JiY7iw Hello Zhopa! Google.

  • 12 Buuster // Dec 20, 2007 at 7:49 pm

    MAopQF Hello Zhopa! Google.

  • 13 Arian // Dec 21, 2007 at 12:02 am

    Does anyone know how to add into the script a way to block websites, like i could block a website and if someone tried to go to it through the proxy it would take it to a custom error page that i made.

  • 14 Arian // Dec 21, 2007 at 12:23 am

    O i forgot to ask if there is a way to have a built-in flash on my domain, because i schools computers dont let you install flash for like youtube and stuff, so i was wondering if there is a way to get a file to install on my hosting to just run flash from it, like a plug-in or something???

  • 15 jhonny // Dec 21, 2007 at 10:00 am

    yeah. I know this

  • 16 jamie // Jan 4, 2008 at 8:00 pm

    ur hot!!!!!

  • 17 Steve // Feb 7, 2008 at 2:31 am

    Thanks, this worked with no problem.

  • 18 proxy // Feb 11, 2008 at 6:57 pm

    how to log all the user details

  • 19 Taley // Feb 22, 2008 at 9:39 pm

    dude i like really need to no a way to UNblock myspace from the skools u no how???

  • 20 amy pope // Mar 13, 2008 at 2:44 pm

    heya! culd u plz tel me a proxy site that i cn get in2 wen im in skwl!

    plzzzzzzz

  • 21 Floroskop // Mar 18, 2008 at 9:58 am

    Hello!
    I think this try.

  • 22 immmy bizzle // May 12, 2008 at 8:24 am

    gimme a fukin proxy desprsate im a bebo junky

  • 23 Jak // Jul 8, 2008 at 10:46 pm

    Hey, this doesn’t work for me. I added the above and it just comes out with a blank page when I use the proxy.

    Any ideas, thanks.

  • 24 JD // Jul 10, 2008 at 9:10 pm

    New undercover proxy
    http://www.exams-help.com/studentportal
    user: hello
    pass: hello

  • 25 operation internet freedom // Aug 25, 2008 at 4:37 pm

    no download, no register, no spyware, adware and 100% free and clean!! bypass web filter with http://www.orangezone.co.cc remember lay low and don’t share with your friends!! remember to clear the browser cache and history too.

    also don’t forget to subscribe for the mailing list, got some premium VIP proxy there

    goodluck

Leave a Comment