Passing data from one server to another

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
stom
Forum Newbie
Posts: 6
Joined: Thu Mar 11, 2010 1:04 pm

Passing data from one server to another

Post by stom »

Suppose that there are 2 applications. One is in my server and the other is a different server. I want to have a link in the remote application which when clicked should open the webpage in my application. Some data should also be sent to my webpage so that i can preload the textboxes with that data.

I am thinking of using webservices, but i am not sure how to write the code for this. Please help me out.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Passing data from one server to another

Post by requinix »

Easiest method would be to have the server POST data to wherever on your server.
stom
Forum Newbie
Posts: 6
Joined: Thu Mar 11, 2010 1:04 pm

Re: Passing data from one server to another

Post by stom »

Thanks... but will the POST work even if the remote application is in .net and my application uses php?
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Passing data from one server to another

Post by AbraCadaver »

The answer is yes if you know how to code the post action in the .NET app and to receive it in the PHP app. Depending upon the sensitivity of your data and the amount of data, you might use GET parameters:

remote app

Code: Select all

<a href="http://example.com/php_app.php?text1=foo&text2=bar">Click</a>
php app

Code: Select all

$text1 = $_GET['text1'];
$text2 = $_GET['text2'];
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply