Solved

Website Communication

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

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 82

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 82

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 82

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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 …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …

706 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

19 Experts available now in Live!

Get 1:1 Help Now