local - Website Detect "In-House Access" -


tl;dr: how detect local website users?

i have self-hosted website running in student-building live in. in website page , links local applications, webremote of rpi running kodi, ftp, page of instructions etc.

i don't want visible random internet users, there way website detect whether user accessing website inside local network? preferably in javascript, php fine.

in php can done in several ways. simplest way simple ip check.

if ($_server['remote_addr'] = "10.1.0.25") {  // internet ip or ip rangehere    // show links internal users } else {    // show stuff other users } 

or range of ips assuming 192.168.1.x addresses

if ($_server['remote_addr'] >= "192.168.1.1" && $_server['remote_addr'] <= "192.168.1.1") {   // internal info } else {   // external info } 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -