Well... I suppose you could try connecting to the databases:
$db1 = mysql_connect('server1', 'username', 'password');
$db2 = mysql_connect('server2', 'username', 'password');
if(!$db1 || !$db2) {
// uh oh, something went wrong...
}
EDIT: And of course, if you want it to automatically submit a form, you'd probably want to look at the [man]cURL[/man] extension to POST the data.