A
A
Alexander Abakumov2019-06-07 00:56:45
WiFi
Alexander Abakumov, 2019-06-07 00:56:45

How to advertise on Mikrotik, Hotspot, radius+mysql?

Good time gentlemen colleagues.
I am building a network of hotspots on Mikrotiks.
It looks like this:
Access point, in it I redirect users to the server with authorization. It registers the user via SMS, sends SMS, writes to the mysql database. As a result, it is redirected back to Mikrotik using the link:

http://IP_or_name/login?username=9001234567&password=pass&advert-pending=yes

in the database in my table "radgroupreply" there are fields with the attributes "Mikrotik-Advertise-URL", here is the address, for example ya.ru and "Mikrotik-Advertise-Interval", here is a timeout.
redirection occurs after a specified interval, but in this way:
1. a new tab or page opens and the address opens in it:
http://ip_or_name/advert?dst=http%3A%2F%2Fwww.gstatic.com%2Fgenerate%5F204
with text in English what type if your page does not open, then follow the link. If the rap browser is swamped, then another window will open in parallel and there will be an address: http://ip_or_name/ya.ruand naturally Mikrotik displays a 404 error, since there is no such file / directory.
Question.
How to make sure that the correct link to the advertising page is formed? To open the advertising site, as well as during authorization. If the password is entered correctly from SMS, the user is redirected to an advertising page.
The advertising page must be taken from the database, in fact, it is taken, only the link is formed somehow correctly or something.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question