brown2005 Posted March 7, 2007 Share Posted March 7, 2007 say i own, websites www.a.co.uk www.b.co.uk if i have data stored on website www.a.co.uk can i use this on www.b.co.uk without setting up a new database? Link to comment https://forums.phpfreaks.com/topic/41692-using-table-from-one-website-on-another/ Share on other sites More sharing options...
boo_lolly Posted March 7, 2007 Share Posted March 7, 2007 yes, it is possible. Link to comment https://forums.phpfreaks.com/topic/41692-using-table-from-one-website-on-another/#findComment-202070 Share on other sites More sharing options...
techiefreak05 Posted March 7, 2007 Share Posted March 7, 2007 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. ;-) Link to comment https://forums.phpfreaks.com/topic/41692-using-table-from-one-website-on-another/#findComment-202104 Share on other sites More sharing options...
mainewoods Posted March 8, 2007 Share Posted March 8, 2007 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. Link to comment https://forums.phpfreaks.com/topic/41692-using-table-from-one-website-on-another/#findComment-202239 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.