Allow WiFi connection after personal URL set in Captive Portal

Hi there,
I want to display publicity once the user connect`s to the WiFi.
I place the URL of my publicity in the Captive Portal,
When I tested it, after the publicity is displayed there´s no WIFI connection.
I need to validate the WiFi connection.

But I don´t know how,
Do I need an specific code to do that?

Can you take some screenshot to show this?