Gruzin Posted January 12, 2007 Share Posted January 12, 2007 Hi guys,I want to transfer some data from one server to another, but:1. URL file-access is disabled in the server configuration (I wanted to require php file from other server, but it's disabled)2. I can connect to mysql db from one server to anotherHow can I transfer some data from one server to another? Is there any other way?Thanks for any help,George Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/ Share on other sites More sharing options...
taith Posted January 12, 2007 Share Posted January 12, 2007 if your talking about copying files, it would simply be a copy/paste...if your talking aobut the database, you'd want to backup the database, put it into a array, then connect to your new one, and import it there... Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159158 Share on other sites More sharing options...
Gruzin Posted January 12, 2007 Author Share Posted January 12, 2007 OK, I'll explain it:I have a server A with mysql db and some data in it. And I have a server B (from wich I can not connect to server A's mysql db). I want some data (image name, apartment name and etc) to be displayed on server B. Is there any way to do this?Thanks,George Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159166 Share on other sites More sharing options...
taith Posted January 12, 2007 Share Posted January 12, 2007 in realtime? or just transfering the information over? Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159169 Share on other sites More sharing options...
Gruzin Posted January 12, 2007 Author Share Posted January 12, 2007 Yes in realtime, the thing is that I want to show the records of db from server A on server B... :) Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159173 Share on other sites More sharing options...
redbullmarky Posted January 12, 2007 Share Posted January 12, 2007 if it's in realtime, you could set up an XML API-type thing on server A (like RSS would work) and parse the info on server B... Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159174 Share on other sites More sharing options...
Gruzin Posted January 12, 2007 Author Share Posted January 12, 2007 [quote author=redbullmarky link=topic=122109.msg503197#msg503197 date=1168617978]if it's in realtime, you could set up an XML API-type thing on server A (like RSS would work) and parse the info on server B...[/quote]YES!!! that's what I thought, but unfortunately I know nothing about it... can u please provide any example or any tutorial?Thanks,George Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159175 Share on other sites More sharing options...
redbullmarky Posted January 12, 2007 Share Posted January 12, 2007 well you dont really need to follow the strict rules of XML/RSS to get you started, so you could literally have somethign quite simple that just echo's out the fieldsserverA.php[code]<?php$id = $_GET['id'];$query = "SELECT a,b,c FROM mytable WHERE id = '$id'";$records = query stuff to get your recordsforeach($records as $record){ echo "{$record['a']},{$record['b']},{$record['c']}\n";}?>[/code]serverB.php[code]<?php$contents = file_get_contents("http://serverA.com/serverA.php?id=2");$records = explode("\n", $contents);foreach($records as $record){ list($a, $b, $c) = explode(',', $record); echo "a=$a, b=$b, c=$c <br />";}?>[/code]quick and dirty, and possibly many many better ways - but should give you an idea.cheers Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159184 Share on other sites More sharing options...
Gruzin Posted January 12, 2007 Author Share Posted January 12, 2007 Both are php files, right?Thank you redbullmarky very, very much! Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159191 Share on other sites More sharing options...
redbullmarky Posted January 12, 2007 Share Posted January 12, 2007 yes, both php and both named after the server they'd go on. obviously how much you use this would depend on the nature of the data you're exchanging - for example, you wouldnt want to use something like this on a 'users' table, etc and you might still want to put something in place that would only allow access to serverA.php if called from serverB.php, and not direct access.still, should set you on your way ;) Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159195 Share on other sites More sharing options...
Gruzin Posted January 12, 2007 Author Share Posted January 12, 2007 Great! You've saved me ;D Thanks again! I will add you in my buddy list ;) Quote Link to comment https://forums.phpfreaks.com/topic/33904-transfering-data-from-one-server-to-another/#findComment-159196 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.