Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <?php
- include "captiveportal-functions.php";
- $loc1="captiveportal-location1.html";
- $loc2="captiveportal-location2.html";
- $ip=$_SERVER['REMOTE_ADDR'];
- echo "Your Ip Is $ip";
- if(contains("20.20.20",$ip)||contains("10.5.25",$ip)){
- $target=$loc1;
- echo "You should be redirected";
- }
- else {
- $target=$loc2;
- }
- redirectTo($target);
- function contains($substring, $string) {
- $pos = strpos($string, $substring);
- if($pos === false) {
- // string needle NOT found in haystack
- return false;
- }
- else {
- // string needle found in haystack
- return true;
- }
- }
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement