digerati Posted July 15, 2007 Share Posted July 15, 2007 Hi all! I'm trying to read info from a db that's on a central domain from several other domains. I've gotten the information exchange to work in tests, but I'm lacking one piece to make it streamlined. I need to get one of two things to happen: 1. With a script on the main domain, read which domain is calling in, therefore serving up the right info from the db. (this is the preferred solution, but I can't seem to get the calling domain from the $_server variables.) 2. Send a variable to the main domain via curl POST. (i tried every sample code snippet I've found, none seem to work!) Anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 15, 2007 Share Posted July 15, 2007 are all the domains pointing to one main domain. Quote Link to comment Share on other sites More sharing options...
digerati Posted July 15, 2007 Author Share Posted July 15, 2007 This is the setup: The db resides on maindomain.com. Several other domains (domain1.com, domain2.com, etc) connect to it to get records from the db specific to those domains. (SELECT * FROM table WHERE id=domain). Right now, i'm having to put separate php files on the main domain for each of the other domains (domain1.php, domain2.php) and hard code the domain variable name into each file. What I'm trying to do is have just one script on the main domain that will either see which domain is calling it and use that info to pull the relevant record from the DB. Right now, the only two ways I can see to do it is to 1. figure out which domain is calling it via $_server variables or something similar, or 2. have the script that's calling in send it's domain in a POST. Is there another way to do this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.