Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    PHP script to show squidguard messages, anyone?

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    4 Posts 2 Posters 5.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fribert
      last edited by

      I'm not in any way a PHP programmer, so I'm asking all you wiz's ;D

      I would like to have squidguard to redirect to an extended url, like:
      intranet/forbudt.php?page=%u&group=%t

      and then have the variables shown on my webpage.

      Now, I have tinkered the PHP code that will display the variables (a lot of work for a nonprogrammer  ;)).

      $page = $_GET['page'];
      $group = $_GET['group'];

      echo "URL: $page  found in the group $group";
      ?>

      And I have a HTML page, question is though, how do I combine them, can I embed PHP on a webpage or what?

      <title>FORBIDDEN</title>

      <big><big><big>FORBUDT</big></big></big>

      The page
      you are trying to vist

      has been banned.

      If you think this is an error

      contact webmaster.

      NO ENTRY

      ???

      1 Reply Last reply Reply Quote 0
      • F
        fribert
        last edited by

        Heh, got it sorted (always helps with a bit of sleep).
        I had found a page that explained that it could be embedded, but it didn't work.
        What I hadn't considered was to change the extension to PHP, as soon as I did that, it worked like a charm.

        So now I have my simple page that says forbidden, and even gives a reason for it :-)

        1 Reply Last reply Reply Quote 0
        • M
          Monoecus
          last edited by

          Where did you put your page to? Is it running on the pfsense box?

          1 Reply Last reply Reply Quote 0
          • F
            fribert
            last edited by

            @Monoecus:

            Where did you put your page to? Is it running on the pfsense box?

            I have my website hosted on my NAS box (QNAP), and I've made a virtualhost just for this purpose, it works like a charm!
            Then I just redirect to that host with the arguments I want to show on the page.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.