Jump to content

curl post or domain referrer...


digerati

Recommended Posts

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?

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.