Modify hotspot login.html - Added custom field which i would like to write to the mikrotik configuration

Gents,
Pulling my hair trying to get this to work. I have a decent networking background but beginner programming/language experience.

The idea is to have a custom field to the hotspot login.html page which lets you choose for how many days you want to use the internet for and expires after till you enter your password again and approve the time.

Now adding a custom field “Allow Access For” below the password field was a piece of cake. The drop down menu next to it has options like 1 week, 2 week, 3 weeks etc etc which after the user has selected writes the data to the mikrotik (lets says cookie expiry time for instance depending on what the user chooses).

I just need someone to point me at the direction how a custom field in the login.html page can modify the router configuration as soon as the user logs in. i already looked at routeros_api.php and a few other things which don’t make sense to me. I hope there is a simple way to do this.

I am going to bed now as i have a headache researching all day on how to do it?

Your valuable suggestions will be much appreciated.

The API is the way to do it.

You just point the form to the PHP file, which would in turn connect to RouterOS and do the thing.

How would you do what you want from the command line? Like, if people had told you what they want in person, and you were forced to do it from the “New Terminal” window. That’s the real question… Once you know that, translating that into API commands should be easy.

Yea executing commands on cli is pretty straight forward. . . Its just the integration of the weg page to have run cli commands at the back end considering user input. I am going to look into PHP file now which would log in to the router and run the commands.

Thanks Man