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

    Simple PHP with CP… But

    Scheduled Pinned Locked Moved Captive Portal
    4 Posts 1 Posters 802 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.
    • M
      mercato
      last edited by

      hello, we have a very simple CP with no authentication.

      on our test webserver the PHP code works fine, from our index.php the CP users are redirected to a specific website (which includes their name on the page) and their name & email are written to a CSV file

      however when this index.php is uploaded to pfSense, neither of those 2 things happen.

      Here is the PHP code copied to a txt file, does anyone have comments please?

      index-php.txt

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

        I have noticed a very basic error (I'm not the coder)
        requirement = Include a form (POST to "$PORTAL_ACTION$") with a submit button (name="accept") and a hidden field with name="redirurl" and value="$PORTAL_REDIRURL$".

        Our index.php has action=""
        and we have omitted action="$PORTAL_ACTION$"

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

          well we substituted action="$PORTAL_ACTION$" for what was there originally, no difference

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

            just to clarify,
            yes the "After authentication Redirection URL" field in CP config works, to the extent that I can nominate a web a page to bring the user to.
            But ideally we require to insert the user name on that page as you see from our PHP code. And that works fine on our test web server (not pfSense) when we use our own redirect coding

            I would like to know if there is a way to pass a variable to the "After authentication Redirection URL" to achieve what we want to do
            www.hayfieldmanor.ie/wifi-landing-page?user=$fname

            And secondly with the user data we capture on the index.php to write the data to captiveportal-data.csv, again our code works on a regular webserver but not when uploaded to pfSense

            Does anyone know what we should do to tweak things and get it working on pfSense?

            Thanks

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