sandshakimi
asked on
PHP IF ELSE Based on IP ?
I want to allow myself a pass-thru to the Drupal login page.
Login page is at /user and my IP is the 69.
Here's part of the code. When i run it, I just get white page.
Login page is at /user and my IP is the 69.
Here's part of the code. When i run it, I just get white page.
$ref = $_SERVER["HTTP_REFERER"];
if(!$user->uid) {
$ip = $_SERVER['REMOTE_ADDR'] == 69.143.164.204)
header ("https://navigator-dev.cap.gsa.gov/user");
} else {
if ($ref != 'https://hallways-dev.fas.gsa.gov/hallways/ITHardware')
{
drupal_goto("https://hallways-dev.fas.gsa.gov/hallways/homepage/welcome.html");
exit();
}else {
$username=base64_decode($_GET['c']);
if($username) {
$myaccount = cas_user_load_by_name($username);
if ($myaccount) {
$user = user_load( $myaccount->uid);
}
}
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Wow, or maybe I'm mistaken. Can you just tell us in plain language what you want to achieve - looking at the code that doesn't work is kind of confusing to me.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.