Jump to content

using table from one website on another


brown2005

Recommended Posts

yes you can, as boo_lolly said. but you do NOT store the database on the website itself, you store it, most times, on a completely different server. unless your "server" is localhost, then it is on the same server, but not directly on the SITE itself. hope this helps. ;-)

If your web sites are on shared hosts and you do not have root access, then you will probably not be able to access the db directly from the remote web site because shared hosts usually do not allow this for security reasons.

 

But you can set up your own simple 'remote db server' by putting a php page on the web site with the db on it that:

 

1) Recieves some query form fields,

2) creates an sql statement from those fields,

3) accesses the db and gets the records,

4) wraps the db data up in XML,

5) and then just echoes that out. 

 

That page would be called from the first web site using the CURL library and sending the query form fields using that. 

 

When the web site with the db on it echoes back the xml file, that file will end up in the string variable that your curl statement assigns to.  You can crack that xml down into fields using simpleXML and then do anything you want with it.

 

Make sure you clean all the query fields before you use them in the sql statement db side.  If you want more security than that you can use md5 hashes and/or passwords to protect the page on the db side.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.