API call for my MQTT

Job ID: 35117430

Budget: $10 – $30 USD

I am building a MQTT system and need from anyone that could guide me or help me figure out a script for connecting with the MQTT server when my SERVER WEBPAGE is OFFLINE, I other words, when I have the HTML page OPEN on my BROWSER I could press buttons and send to my Electronic module ESP32.
The issue is when I closed the HTML then the ESP32 when sending signals from ESP32 module to SERVER will not get signals.

I need some type of API to call the server and able to store the DOOR status of every MQTT ESP32 module.

I am creating a IOT server but the SERVER needs to be open and when I triggers the ESP32 door inputs it reflects on the SERVER but when close the HTML on the server no response.
Related categories: PHP JavaScript Linux MQTT Embedded Systems