Data transfer across servers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
venkeets
Forum Newbie
Posts: 3
Joined: Fri Nov 15, 2002 4:01 am

Data transfer across servers

Post 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.
User avatar
riley
Forum Commoner
Posts: 45
Joined: Thu May 02, 2002 6:31 pm

Post 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");
venkeets
Forum Newbie
Posts: 3
Joined: Fri Nov 15, 2002 4:01 am

Post 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");
User avatar
riley
Forum Commoner
Posts: 45
Joined: Thu May 02, 2002 6:31 pm

Post 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.
Post Reply