Nice, I ported over to the PHP script...works awesome.

Would you know how I can print something on the screen if the
targetgroup variable = something specific.

Here is want I want to do:

If a user browses porn for example. I have a section in my
squidGuard.conf like this,

dest porn {
    log        porn
    domainlist porn/domains
    urllist    porn/urls
}

In the redirected script (the php one), if I do:

print "<li>Error Code: ".$_GET['targetgroup']."</li>";

the results will be:

Error Code: porn

What I want is the results to say:

Error Code: You have accessed a website containing pornographic
material.

So if $targetgroup = porn then print "blah blah"

- Nick



-----Original Message-----
From: Chris Francy [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 09, 2006 1:59 PM
To: Nick Duda; [email protected]
Subject: RE: passing variable to CGI


If you made a PHP script instead of a CGI then it would be a little
easier.  It would require having php installed on your web server
though.


#squidguard redirect
redirect
http://127.0.0.1:8000/ERR_ACCESS_DENIED.php?clientaddr=%a&clientname=%n&;
clientuser=%i&clientgroup=%s&url=%u


--------- ERR_ACCESS_DENIED.php ---------
<html><head><title>Access Denied!</title></head>
<body>
<h1>Access Denied!</h1>
<p>This page has been blocked by a web filter at your organization.  If
you disagree with the classificiation of this page send an email to
[EMAIL PROTECTED] and include the details below.
<ul>
<?php
  print "<li>clientaddr: ".$_GET['clientaddr']."</li>";
  print "<li>url: ".$_GET['url']."</li>";
?>
</ul>
</body></html>
------------------


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Nick Duda
> Sent: Thursday, March 09, 2006 10:18 AM
> To: [email protected]
> Subject: passing variable to CGI
>
> Does anyone have a sample script or can supply me with a
> sample cgi that
> will just simply print the results of the $clientaddr. I know pretty
> much nothing about cgi/perl and I'm looking for a script to just print
> that variable when a user hits an error page. Once I know the
> context I
> can craft my own error page.
>
> 
>
> Thanks in advance
>
> N
>
> ---------------------
> Confidentiality note
> The information in this email and any attachment may contain
> confidential and proprietary information of
>
> VistaPrint and/or its affiliates and may be privileged or otherwise
> protected from disclosure. If you are
>
> not the intended recipient, you are hereby notified that any review,
> reliance or distribution by others
>
> or forwarding without express permission is strictly
> prohibited and may
> cause liability. In case you have
>
> received this message due to an error in transmission, please
> notify the
> sender immediately and to delete
>
> this email and any attachment from your system.
> ---------------------
>
>



---------------------
Confidentiality note
The information in this email and any attachment may contain confidential and 
proprietary information of
VistaPrint and/or its affiliates and may be privileged or otherwise protected 
from disclosure. If you are
not the intended recipient, you are hereby notified that any review, reliance 
or distribution by others
or forwarding without express permission is strictly prohibited and may cause 
liability. In case you have
received this message due to an error in transmission, please notify the sender 
immediately and to delete
this email and any attachment from your system.
---------------------

Reply via email to