Greg
Greg

Reputation: 354

Retrieve WLAN SSID Name in PHP to display restricted content

I have to display content that should only be accessed from a given location. While I did consider geolocation for a minute, resticting the content based on the WLAN Name the client is connected to seems much more suitable.

The closest the PHP documentation comes to is Session-ID. Not what I need.

Any direction where I could look at ?

Edit : A good real-life example would be students in a school. They'd come with their own devices, connect onto the school WLAN and get access to some content not visible otherwise. The content is not hosted onto the school servers. I'm not looking for high security level, not a matter of life and death, something "basic" would do.

Edit 2: What you are all saying probably makes more sense technically speaking than the solution I initially had in mind. + the link provided is really useful.

Upvotes: 1

Views: 4349

Answers (1)

John Chrysostom
John Chrysostom

Reputation: 3983

PHP executes on the server. The client is what connects to the wireless network. This is impossible, without some sort of client-side plugin that gets the WLAN SSID, and to my knowledge none exists. Furthermore, what's to stop somebody from just changing their SSID?

What you probably want to do is restrict it based on IP address... look here: How to get the client IP address in PHP?

Upvotes: 2

Related Questions