It was not possible to find any information about this, but wondered if there was any way to determine if the user is on a Wi-Fi connection, in particular public Wi-Fi, using javascript or php?
No, no, there is nothing in IPv4 and HTTP transport that even hints at which connection is being used, except for the most basic protocol, which is usually IPv4 and HTTP.
No, IPv6 also does not include this information.
There are two ways to do this that I know of:
Check the IP address of the database. By the way, this option gives you much more information about the carrier. It can also provide you with the location and name of the Internet service provider, domain that matches this IP address, lat / long, zip code, time zone, etc. Etc. See http://www.quova.com/ for a RESTful API that allows this.
Programmatically: this only works on Android version 2.2+. This is a simple check for navigator.connection. Hope this helps. Here is the test page:
<html> <head> <script type="text/javascript"> function checkWIFI() { var output = document.getElementById('connectionCheck'); var html = "Checking...<br/>Connection: "; if (navigator.connection) { var type = navigator.connection.type; switch (type) { case navigator.connection.UNKNOWN: html += "Unknown"; break; case navigator.connection.ETHERNET: html += "Ethernet"; break; case navigator.connection.WIFI: html += "Wifi"; break; case navigator.connection.CELL_2G: html += "Cell 2G"; break; case navigator.connection.CELL_3G: html += "Cell 3G"; break; default: html += "Missing"; } } else { html += "Connection type not supported."; } output.innerHTML = html; } </script> </head> <body onload="checkWIFI();"> <div id="connectionCheck"> </div> </body> </html>
You can get some information about the user IP address, the OS used, the protocol. But you cannot get information about the media used, which the user uses to connect to the Internet. There are some speed testing tools for analyzing the connection speed that the user is connected to, but the wireless connections do not have any significant speed mark or anything else to identify it.
Not. Well, you can check their IP against any theoretical database - in a very limited number of cases, this can tell you.
But Javascript by design does not reveal enough about the user, and there is definitely no way to find out PHP if he cannot somehow convince the client to share.