Solved

Website Communication

Posted on 2015-01-23
7
53 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

11 Experts available now in Live!

Get 1:1 Help Now