Javascript – How do I connect to WIFI from a browser using Javascript and PHP?

How do I connect to WIFI from a browser using Javascript and PHP?… here is a solution to the problem.

How do I connect to WIFI from a browser using Javascript and PHP?

I worked on creating a Linux digital signage box that my customers can buy and choose what they want to display on it.
Currently, it is launched in Firefox, check if it has internet, query my server and get the unique URL that Firefox has changed to.
If it doesn’t have any internet connection, I display a page “You don’t have internet, connect an Ethernet cable or connect to WIFI.” ”

My question is, what is the best way to allow my clients to connect to wireless hotspots from Firefox? My thoughts at the moment are:

I ADDED A “CONNECT WIRELESS” BUTTON THAT CALLS A PHP SCRIPT WITH SOME JAVASCRIPT, IT CONNECTS TO BOX (LOCALHOST) VIA SSH, AND THEN FIRST FINDS ALL WIFI HOTSPOTS USING CONNMANCTL IF THEY REQUIRE A PASSWORD. Then Javascript shows this, then connects again via SSH and so on.

Do you know about open source systems? Or better way?

Solution

That’s what I’ll do.
You can run system code using the function shell_exec Use this function in your PHP script to execute your Linux distribution’s native WiFi connection possibilities. Most likely to answer how to do this for your distrohere .
Good luck!

Related Problems and Solutions