How to build a http form for wifi connections?

Hi there,
i don’t know if it is the correct section or even the right forum to ask forrotfl!

in public places, such as bar, or shops and post offices, i can connect to their network, through a http form, so first i need to be registered and then i can “login” to the web.
How to do that?
Is that a funcion running in their routers, or there’s a computer in the middle, that redirects the network traffic after logged in?