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

    Display client MAC on captive portal login page.

    Scheduled Pinned Locked Moved Captive Portal
    4 Posts 3 Posters 1.0k 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
      FlashEngineer
      last edited by

      So maybe this is more of HTML/PHP thing, but I see the /usr/local/captiveportal/login.php has $clientmac…  I uploaded my own html page in the captive portal for the login page.  Now how do I access this variable in my html page to display it?

      1 Reply Last reply Reply Quote 0
      • DerelictD
        Derelict LAYER 8 Netgate
        last edited by

        Lots of php in the default login page to look at. Should be trivial if you know the name of the variable you want.

        Chattanooga, Tennessee, USA
        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
        Do Not Chat For Help! NO_WAN_EGRESS(TM)

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

          I'm not sure how or what to do?  I never really did HTML or php… How do I link the php functions in my HTML file?

          1 Reply Last reply Reply Quote 0
          • T
            tux
            last edited by

            on your captive portal form you can use the macaddress through this codes:

            $arp=`arp $ipaddress`; #run the external command, break output into lines
            $lines = explode(" ", $arp);
            $macaddr = $lines[3]; #Actual code
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.