help with hotspot page

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?

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Company Free WiFi</title>
  <link rel="stylesheet" href="css/style.css">
</head>
<body>
  <section class="container">
    <div class="login">
      <h1>Enter User and Password for free WiFi</h1>
      <form method="post" action="index.html">
        <p><input type="text" name="login" value="" placeholder="Username"></p>
        <p><input type="password" name="password" value="" placeholder="Password"></p>
        <p class="submit"><input type="submit" name="commit" value="Login"></p>
      </form>

	  			<tr><td align="center">
				<a target="_blank" style="border: none;" href="http://www.meeeee.com">
				<img src="css/img/logobottom.gif" alt="My picture" width="150" height="40" /></a></td></tr>
		</table>

	<br /><div style="color: #c1c1c1; font-size: 9px"><font color="#0000FF">
			Powered by David</font>
			</div>
    </div>
</body>
</html>

I think the login name field should be called username and not login.
(the default HTML page the Mikrotik generates uses that name)

no ,
it doesn’t change nothing

anything else maybe?

form action=index.html seems wrong too. Compare with the default login page that Mikrotik generates… (I don’t have a hotspot to compare with

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.

as you cab see I don’t use Java script

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.

yes I have try this

only PAP is enable

Here is the meat-and-potatoes part of the default login page from Mikrotik:

<form name="login" action="$(link-login-only)" method="post">
  <input type="hidden"   name="dst" value="$(link-orig)" />
  <input type="text"     name="username" value="$(username)"/>
  <input type="password" name="password" />
  <input type="submit"   value="OK" />
</form>

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?

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Company Free WiFi</title>
  <link rel="stylesheet" href="css/style.css">
</head>
<body>
  <section class="container">
    <div class="login">
      <h1>Enter User and Password for free WiFi</h1>
      <form name="login" action="$(link-login-only)" method="post">
      <input type="hidden" name="http://www.google.com/" value="$(link-orgin)" />
        <input type="text" name="username" value="$(username)" />
        <input type="password" name="password" />
        <input type="submit" name="commit" value="OK" />
      </form>

	  			<tr><td align="center">
				<a target="_blank" style="border: none;" href="http://www.mycompany.com">
				<img src="css/img/logobottom.gif" alt="davidLTD" width="150" height="40" /></a></td></tr>
		</table>

	<br /><div style="color: #c1c1c1; font-size: 9px"><font color="#0000FF">
			Powered by davidLTD.</font>
			</div>
    </div>
</body>
</html>

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.

yes I made a mistake between “name” and “value”

Thanks for showing me this

Thank you for the help
:slight_smile: