This topic is locked
[SOLVED]

 how to clone a project and be secure?

9/26/2014 1:28:09 PM
PHPRunner General questions
W
wfcentral author

I am building a project that will be sold to many clients / businesses.
The project will sit on my website in folders like (examples)
/jones

/acme

/microsoft

/intel
I am creating a separate database for each project and then manually modifying the /includes/dbcommon.php to point to the right database.
In this way I hope to only maintain one phprunner project and just copy it to each folder.
PROBLEM... I have tested this and if I log in at /jones version and then just change the URL to /acme version I can see all THEIR DATA...
How can I keep these different projects separate.
Or to answer another question - how do you build software that you plan to clone without users be able to change URL and access data they should not be seeing?
There has to be a way to keep these sessions separate??

W
wfcentral author 9/26/2014

I found the solution - found the cookie session variable stored in dbcommon.php for projects running on same server...

J
johnP 9/29/2014

You can use this at server database connections:
$parse = $_SERVER['SERVER_NAME'];
// Localhost ()

if($parse == "localhost"){

$_SESSION["dbname"]="xxxxxxx";

$user="xxxxx";

}
// second site

if($parse == "xxxx.secondsite.com"){

$_SESSION["dbname"]="ddddd";

$user="ddd";

}