Solved

Website Communication

Posted on 2015-01-23
7
52 Views
Last Modified: 2015-02-11
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
Comment
Question by:rgranlund
  • 4
  • 3
7 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40567291
Why don't you just POST it from the form on A to the PHP page on B?
0
 
LVL 7

Author Comment

by:rgranlund
ID: 40567296
What about if I wanted to send info straight to site B's Database?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40567376
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 7

Author Comment

by:rgranlund
ID: 40567429
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
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40567444
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
 
LVL 7

Author Comment

by:rgranlund
ID: 40568391
That makes sense.  Can you briefly elaborate on "Use two different connections"
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40568490
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now