Accessing another domains central info..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tasari
Forum Newbie
Posts: 1
Joined: Sat Mar 11, 2006 4:31 pm

Accessing another domains central info..

Post by tasari »

I would like to be able to access the information, like username and password, on domain name A via a php script on domain B

For example :
I have a vars.php on my domain name A
I launch/access a php program on domain B or domain C or domain D or domain E or ..... which will read the variables in the vars.php file of domain name A..

How do I do that correctly ? Can anyone help me with this code ? I am a beginner :-)

In vars.php I have :
$db_username = "test";
$db_password = "test";

So I need a php script read_info.php that will read this from domain A, after that I can use this to log in a user/password protected dir or the mysql database of domain A !

Why do I want to do this ? So I need to change on ONE place username and password, so automatically ALL the other domains (5 or 10 domains) can access it and have access to the CENTRAL database which is on domain A !

Of course nobody will ever know which name I will choose for this php file ! Nor anyone will know which name of variables I will choose !
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

make a request for the file (which must output its source code) via include()

Note: this can be extremely dangerous if that file is altered maliciously or you rely on "user" input to tell you exactly where to get the data from.
Post Reply