Community discussions

MikroTik App
 
efolch
just joined
Topic Author
Posts: 1
Joined: Thu Apr 15, 2021 4:39 pm

Send Global Variable in Hotspot redirection

Fri Apr 16, 2021 4:55 am

Hello! I'm new in the forum and in scripting too.

I've made this script for get WLAN1 macAddress (i need send that info to external portal hotspot).

1) This is the script i made.. when I run it, I see in terminal that variable have been succesfull set:
########################
:global macWlanLab [/interface get [/interface find default-name=wlan1] mac-address ];
log info "$macWlanLab";
################################
2) I also see that "enviroment" is well set here:
[admin@Gateway] /system script environment> print
# NAME VALUE
0 macWlanLab XX:XX:XX:YY:YY:YY
################################
3) In other hand I've configure the login.html hotspot, with this redirection params setting:

<form id="redirect" name="redirect" action="" method="post">
<input type="hidden" name="hotspotname" value="Gateway"/>
<input type="hidden" name="servername" value="$(server-name)"/>
<input type="hidden" name="mac" value="$(mac)"/>
<input type="hidden" name="ip" value="$(ip)"/>
<input type="hidden" name="username" value="$(username)"/>
<input type="hidden" name="link-login" value="$(link-login)"/>
<input type="hidden" name="link-orig" value="$(link-orig)"/>
<input type="hidden" name="error" value="$(error)"/>
<input type="hidden" name="chap-id" value="$(chap-id)"/>
<input type="hidden" name="chap-challenge" value="$(chap-challenge)"/>
<input type="hidden" name="link-login-only" value="$(link-login-only)"/>
<input type="hidden" name="macLab" value="$(macWlanLab)"/>
<input type="hidden" name="identity" value="$(identity)"/>
</form>
################################
4) But when the redirection happends.. The value is not sent:
(see Image "Capture.PNG" attached).
################################

Any help or diferrent approuch to send this custom param in first redirecction I'll be really grateful..

Thanks!
Eric
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 19 guests