]>
Commit | Line | Data |
---|---|---|
25697a35 GS |
1 | <?php |
2 | ||
3 | /* | |
d6e703cc FM |
4 | * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com |
5 | * 1998, 2006 | |
25697a35 GS |
6 | * SARG Squid Analysis Report Generator http://sarg-squid.org |
7 | * | |
8 | * SARG donations: | |
9 | * please look at http://sarg.sourceforge.net/donations.php | |
10 | * --------------------------------------------------------------------- | |
11 | * | |
12 | * This program is free software; you can redistribute it and/or modify | |
13 | * it under the terms of the GNU General Public License as published by | |
14 | * the Free Software Foundation; either version 2 of the License, or | |
15 | * (at your option) any later version. | |
16 | * | |
17 | * This program is distributed in the hope that it will be useful, | |
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | * GNU General Public License for more details. | |
21 | * | |
22 | * You should have received a copy of the GNU General Public License | |
23 | * along with this program; if not, write to the Free Software | |
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. | |
25 | * | |
26 | */ | |
27 | ||
28 | $filename = "/usr/local/squid/etc/block.txt"; | |
29 | ||
30 | $url = $_GET['url']; | |
31 | $url = $url."\n"; | |
32 | ||
33 | $ha = fopen($filename, 'a'); | |
34 | if ($filename == false) { | |
35 | print (gettext ("Could not open the filename")); | |
36 | echo ' '.$filename; | |
37 | exit; | |
38 | } | |
39 | else { | |
40 | $written = fwrite($ha, $url); | |
41 | fclose($ha); | |
42 | if ($written != strlen($url)) { | |
43 | print (gettext ("Write error")); | |
44 | exit; | |
45 | } | |
46 | print (gettext ("Done!")); | |
47 | echo "<br><br>\n"; | |
48 | echo "<a href=\"javascript:history.go(-1)\">"; | |
49 | print (gettext("Return")); | |
50 | echo "</a> "; | |
51 | print (gettext (" to Sarg.")); | |
52 | } |