Page 1 of 1

Data transfer across servers

Posted: Fri Nov 15, 2002 4:01 am
by venkeets
Hello,
Can I transfer form data which i capture using a PHP file running on Apache/Linux server to an application on window NT which would process the data and send back the results to Linux ?
Can anyone help me on this.

Thanks in advance.

Posted: Fri Nov 15, 2002 7:18 am
by riley
It's really the same as to the current server you only need permission.

//Since it's NT here is a MSSQL Connect String

$host = "DistantServer"; //you may need port Num also
$username = "PermittedUser";
$password = "PermittedPass";
$dbname = "Database";

MSSQL_CONNECT($host,$username,$password) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db($dbname) or DIE("Table unavailable");

Posted: Mon Nov 18, 2002 3:52 am
by venkeets
riley wrote:It's really the same as to the current server you only need permission.

Thanks for your reply.
but i would like to have more info on that.
For Example

I visit to a page : http://mydomain.com/info.php which comes from Linux
I have to fill in some form fields and when i submit that page,I have to transfer or post the data to an application which is on WinNT.
Is it possible ? if so how can i do it??

Thanks


//Since it's NT here is a MSSQL Connect String

$host = "DistantServer"; //you may need port Num also
$username = "PermittedUser";
$password = "PermittedPass";
$dbname = "Database";

MSSQL_CONNECT($host,$username,$password) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db($dbname) or DIE("Table

unavailable");

Posted: Mon Nov 18, 2002 7:54 pm
by riley
This is form on the Linux Box.

Code: Select all

<Form Action='http://www.ntbox.com/editdata.php' Method='POST' Name='frmEditData'>
<Input Type='Text' Name='Data1'>
<Input Type='Submit' Value='Edit'>
</Form>
This is NT Box running IIS that has the ability to conncect with Mssql maybe even on yet another box. This is

Code: Select all

<?
mssql_connect("NTBoxRunningSql", "Username", "Password");
mssql_select_db("database") or DIE("Table unavailable"); 

$query = "Insert $Data1 Into Table"; 

$result = MSSQL_QUERY($query); 
Echo MSSQL_NUM_ROWS($result); 
?>
Hope this helps a little. If not give a more detailed explanation of what application you are trying to update.