pfSense English Support > Captive Portal

Is it possible for me to display a users IP address on the login page??

(1/3) > >>

Tram:
Is it possible for me to display a users IP address assigned to them by the pfsense DHCP server on the login page?? i want to do this so that when the view bandwidthd which is a link on the page they know which IP is theres and view there statistics.

I know the login page is a basic html page but it says something in the captive portal file manager about using php but i don't know how to do it.

Thanks

JorgeAldoBR:
put this where you want the ip to appear :

<?php echo getenv('REMOTE_ADDR'); ?>


jeroen234:
upload this page as youre pfsense portal page


--- Code: ---HTML>
<HEAD>
<META HTTP-EQUIV="REFRESH" CONTENT="1";URL="$PORTAL_ACTION$p.php?portal_action=$PORTAL_ACTION$&portal_redirurl=$PORTAL_REDIRURL$">
</HEAD>

<BODY>
</BODY>
</HTML>

--- End code ---

now it will send you to p.php afther 1 sec

p.php


--- Code: ---<?
echo "<br><br><br>";
echo "Welkom youre ipadress = ";
echo getenv('REMOTE_ADDR');
echo "<br><br>";
?>
<table>
<form method="post" action="<?php echo $_GET["portal_action"]; ?>">
<tr><td><h3>usernaam</h3></td><td><input name="auth_user" type="text"></td></tr>
<tr><td><h3>wachtwoord </h3></td><td><input name="auth_pass" type="password"></td></tr>
   <input name="redirurl" type="hidden" value="<?php echo $_GET["portal_redirurl"]; ?>">
   <tr><td><input name="accept" type="submit" value="Continue"></td><td></td></tr>
</form>
</table>



--- End code ---

JorgeAldoBR:
Why my code doesnt work ? (I did not try it, but i presume now that it doesnt work)

jeroen234:
ehmm i don't see code from you ??

Navigation

[0] Message Index

[#] Next page

Go to full version