phpMain at headquarter for login control & mysql database
phpA at branch office A, has phpA web for sharing d:\dataA\sharing
phpB at branch office B, has phpB web for sharing d:\dataB\sharing
user(s) will login to phpMain/index.php, after login can access phpA/fileshare.php & phpB/fileshare.php, but the problems is phpA/fileshare.php or phpB/fileshare.php no need to login, as they are not under phpmain/, they are located a phpA & phpB.
added below code into phpA/fileshare.php & phpB/fileshare.php, but always stop at the phpMain/index.php
Code: Select all
session_start();
if (!isset($_SESSION['username']) || $_SESSION['username'] == '') {
header ("Location: http://www.phpmain.com/index.php");
exit();
}