Parameter Replacement Not Happening in Redirection to Captive Portal

We’re using a an external captive portal to handle authentication on Mikrotik routers for a client. At present, we’re working with the 1100AHx2 model, version 6.31. For some reason, and not consistently, there are instances in which the MT sends the form data, but does no perform parameter replacement, so what we get from the router is:

    [MA] => $(mac)
    [IP] => $(ip)
    [username] => $(username)
    [OS] => $(link-orig)
    [error] => $(error)
    [interface] => $(interface-name)
    [var] => $(var)
    [status] => success

This appears to be coming from the alogin.html script, which we have configured thus:

<html>
<head>
<title>mikrotik hotspot > redirect</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">

<body>
<form name="success" method="post" action="https://<xxxxxxxxxx.com/guests/welcome/1001209">
	<input type="hidden" name="MA" value="$(mac)">
	<input type="hidden" name="IP" value="$(ip)">
	<input type="hidden" name="username" value="$(username)">
	<input type="hidden" name="OS" value="$(link-orig)">
	<input type="hidden" name="error" value="$(error)">
	<input type="hidden" name="interface" value="$(interface-name)">
	<input type="hidden" name="var" value="$(var)">
	<input type="hidden" name="status" value="success">
</form>
<script type="text/javascript">
	document.success.submit();
</script>
</body>
</html>

As you can see, we’re not getting the values, but the parameter names. Obviously, this won’t work. Does anyone have any ideas why this behavior might be occurring?

Thanks,

Jim

Hello. There is a mistake on the html. It is clearly a php webpage, or dynamic webpage. Just eliminate the " when passing parameters. Using this " is turning the variable name into a stringa valuen, which in turn is what you get on the webserved captive portal page.

For example, instead of

Use

It will work in this way, for sure.

CG