Custom Status page

Hi

I want to know if its possible to create my own sort of “status.html” for my hostpot users, one thats sitting on my external webserver. Obviously creating the page is fine etc but how can I pull the values that status.html in mikrotik has? like bytes-remaining etc?

can this be done?

thanks

if you use RADIUS for hotspot user authentication, you could take data from there

I have not tried this, so don’t blame me if it doesn’t work. But if I needed what you do, I would try modifying this script for the status.html page. Pass the variables to a php page on your server, extract the variables, and “ya esta!”
http://wiki.mikrotik.com/wiki/HotSpot_external_login_page

ADD: I don’t think this will work as easy as it sounded. You would need to load the status.html page from the router to forward the info to the server. That means redo the meta refresh on the server php code to load the status.html page from the router, then let it redirect back to the server.

Thanks, yes I’m using RADIUS so all the attributes are fine but I would really like to get the stuff like bytes being used etc. (thats the good stuff) which I can’t really get from RADIUS

My way works! Just tried it. I’m watching it work right now. :smiley:

AWESOME, didn’t have time today but will check it out tomorrow. thnx man

Here is what I used for a test. The first is the code for status.html in the router. Replace the xx.xx.xx.xx with the ip of your php-enabled web server.

<html>
<head>
<title>...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
<noscript>
<center>JavaScript required. Enable JavaScript to continue.</center>
</noscript>
<center>updating status<br>
<form name="redirect" action="http://xx.xx.xx.xx/status.php" method="post">
<input type="hidden" name="username" value="$(username)">
<input type="hidden" name="uptime" value="$(uptime)">
<input type="hidden" name="hostname" value="$(hostname)">
<input type="hidden" name="linklogout" value="$(link-logout)">
<input type="hidden" name="linkstatus" value="$(link-status)">
<input type="hidden" name="refreshtimeout" value="$(refresh-timeout-secs)">
<input type="hidden" name="bytesin" value="$(bytes-in-nice)">
<input type="hidden" name="bytesout" value="$(bytes-out-nice)">
</form>
</center>
<script language="JavaScript">
<!--
   document.redirect.submit();
//-->
</script>
</body>
</html>

This is the status.php code for the server.

<?php
   $username=$_POST['username'];
   $uptime=$_POST['uptime'];
   $hostname=$_POST['hostname'];
   $linklogout=$_POST['linklogout'];
   $linkstatus=$_POST['linkstatus'];
   $refreshtimeout=$_POST['refreshtimeout'];
   $bytesin=$_POST['bytesin'];
   $bytesout=$_POST['bytesout'];
?>
<html>
<head>
<title>mikrotik hotspot > status</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
</head>
<body>
Status<br>
User: <?php echo $username; ?><br>
Time: <?php echo $uptime; ?><br>
Host: <?php echo $hostname; ?><br>
Refresh: <?php echo $refreshtimeout; ?><br>
Bytes in: <?php echo $bytesin; ?><br>
Bytes out: <?php echo $bytesout; ?><br>
<a href="<?php echo $linklogout; ?>">Logout</a>
<script language="javascript">
 setTimeout('document.location="<?php echo $linkstatus; ?>"',<?php echo $refreshtimeout; ?>000);
</script>
</body>
</html>

The setTimeout command is one line.

\ \ what about "comment", can't we show comments in status page ?" what is the keyword for comment ?? please help!!