hi
how could I implement logical or among “if” at “Customizing Hotspot or HTML customizations” ?
for example I want implement
'$(if ip == 10.1.2.3 or ip==10.1.2.20) ’
or
'$(if ip == 10.1.2.3-10.1.2.20) ’
You will probably want to get familiar with the scripting language and syntax.
http://wiki.mikrotik.com/wiki/Manual:Scripting#Conditional_statement
http://wiki.mikrotik.com/wiki/Manual:Scripting-examples
Below are some generic examples that might help.
:local ipaddress 10.1.2.3;
:if ($ipaddress = 10.1.2.3 || $ipaddress = 10.1.2.20) do={
:put "ip address matches! $ipaddress";
}
:local ipaddress 10.1.2.15;
:for i from=3 to=20 do={
if ("10.1.2.$i" = $ipaddress) do={
:put "10.1.2.$i matches!" ;
}
}
Can you give more information what you’re trying to do?
hi and thx for your answer,
This is the scenario
realy i have some client with static ip address, when users open their browser they are redirected to hotspot log in page normally, I restrict them to access Internet by firewall but I allow them to access some sites depend on their department. I put the related link in hotspot login page by customizing the login page and HTML codes.
now i want for example A department (for example 10.1.1.2-10.1.1.10) see the related link in hotspot login page and as well B department (10.1.1.20-10.1.1.30), for example 10.1.1.30 and 10.1.1.35 see the user and password box in login page.
in “Manual:Customizing Hotspot” in “Working with variables” use “$(if ip == w.x.y.z)” statement to filter just one client, and what should i do if i want filter a range of ip address?