I have read and took some examples over the web and manage to create a login page as I want
my problem is that I can’t login to the hotspot
I know my mistake is in the login.html - but i can;t find it
can you help me?
What kind of login method do you use? You are missing the function doLogin!
As ZeroByte said find the default mikrotik login.html and work on this one for your changes.
I have try
but there are to many differences between the tow files
I don’t know what I can change and what not.
I don’t know HTML to know what I can change and what not
The doLogin function AiKons mentions is Javascript, and as far as I know, it’s not strictly necessary to use Javascript, so long as your form collects the needed fields and submits them to the right place.
If you’re not using Javascript, then you’ll need to disable CHAP logins and do PAP logins only. That’s one “gotcha” that got me early on. CHAP expects the client to send an MD5 hash of the password, and not the password itself. If you removed the script, then the Mikrotik will compare the user’s plain-text password against an MD5 hash of the local password database, which is guaranteed not to match.
the login.html page I have posted is what I want to use
I have try to take the default page and change it to the one i want to use - without any success …
It can’t be this difficult to fix my login to work with mikrotik? is it?
I don’t understand\know HTML so I will know where is the problem
Did you try disabling CHAP logins and enabling PAP?
That’s a setting in the Hotspot profile configuration. There are checkboxes for various login methods. CHAP is on by default and PAP is off by default. Since you’re not using javascript, CHAP won’t work, so make sure that’s changed.
These can be split up throughout your page, but the following rules apply:
All inputs must come between the and tags.
Leave the $(variable) fields where they are. The Mikrotik automatically replaces them with their values as it generates the HTML for the user. So if you did “view source” in your browser, you wouldn’t see the variables, but the actual values there.. .for instance, the “dst” value would be something like “http://www.mikrotik.com/”
There are other hidden inputs available, and other $(variables) available for more functionality - you can read about them in the documentation, but I recommend that you get the basic thing working first.
Now it’s good
but after I login he give the Status page of my user
I don’t want it - want to only redirect to www.google.com
what did I do wrong? what I need to change?
The file alogin.html displays to users after they login.
You could make that page be a simple page with the google logo and “click here if not automatically redirected” along with a meta-refresh header.
(google will supply you with lots of examples of that)
by the way, this:
doesn’t make sense.
‘name’ on inputs is like the ‘name’ of a button on a control pannel, and value is what it sends when pushed…
It looks like you modified this field:
You would replace $(link-orig) with the link to google.
(and you might as well be nice and make it https:// since google forces that by default nowadays)
Normally, the MT will replace $(link-origin) with whatever URL the browser was trying to go to when the Hotspot intercepted the request, and after successful login, it can send you where you were trying to go in the first place. Replacing that token with a specific URL would have the affect you want.