Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 59
  • Last Modified:

Website Communication

I have two websites.  They are both run on the Expression Engine CMS.
Lets Call them site A and site B.
Site A you fill out a form and hit enter.  First name last name and State.  That information needs to be sent to Site B.  On site be, depending upon the Stae you live in, You will be presented with products and prices.

What is the best way to send this information or any information real time from one site to another?
0
rgranlund
Asked:
rgranlund
  • 4
  • 3
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
Why don't you just POST it from the form on A to the PHP page on B?
0
 
rgranlundAuthor Commented:
What about if I wanted to send info straight to site B's Database?
0
 
Dave BaldwinFixer of ProblemsCommented:
That would still be the best way.  Technically it has to go thru a PHP page since an HTML page can not connect to the database directly.  Just make the 'action' attribute in the form on site A be the page you need on site B.  That is done all the time.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
rgranlundAuthor Commented:
I should ask this question a different way.  If info is entered into Site A's Database, can I use an XML field or something similar to automatically transfer that info into the Database of Site B? I want both DB's to have the same info.
0
 
Dave BaldwinFixer of ProblemsCommented:
Yes, that is a different question.  Are the database tables the same on both sites?  Is the database server on site B remotely accessible from site A?  If that is true, then you can just run the same insert query but use two different connections.  One for A and one for B.
0
 
rgranlundAuthor Commented:
That makes sense.  Can you briefly elaborate on "Use two different connections"
0
 
Dave BaldwinFixer of ProblemsCommented:
Every connection is only to one server.  To connect to a second server, you must make a second connection.
// first MySQL server
$link1 = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link1));
// second MySQL server
$link2 = mysqli_connect("myotherhost","myotheruser","myotherpassw","myotherbd") or die("Error " . mysqli_error($link2));

Open in new window

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now