#148 Internet - Intranet access problem

open
nobody
None
5
2012-09-25
2005-03-27
kaya uluer
No

I use my site on both internet and intranet. so i change
that file like above...

mainfile.php

// XOOPS Virtual Path (URL)
// Virtual path to your main XOOPS directory

WITHOUT trailing slash
// Example: define('XOOPS_URL', 'http://localhost');

// Modified by Y.KAYA ULUER 13.02.2005 auto

chance the host name for
// local or remote access

$yk_local_host_ip    = gethostbyname("localhost");
$yk_user_ip          = $_SERVER['REMOTE_ADDR'];
$yk_pattern          = "'(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d

{1,3})'";
$yk_is_local = ((preg_replace
($yk_pattern,"\1.\2.\3",$yk_user_ip)==preg_replace
($yk_pattern,"\1.\2.\3",$yk_local_host_ip)))?true:false;

if ($yk_is_local) {
    define('XOOPS_URL', 'http://localhost');
} else {
    define('XOOPS_URL', 'http://yku.no-ip.org');
}

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks