954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

POST data from one domain to another ?

Hi,

Let's say i have a form in www.111.com/form.html where user can submit name and surname with POST action.

Can we send the POST data (name and surname) from www.111.com/form.html to www.222.com/process.php to be processed?

Thanks

veledrom
Master Poster
758 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

Hi.

Yes this thing works... Infact, the most famous payment gateway PAYPAL works on this principle...

If you want to make your transaction more secure, use CURL. Using this, you can get your data processed from other server.

Otherwise, this simple POST also works good.

sikka_varun
Junior Poster in Training
94 posts since Dec 2008
Reputation Points: 11
Solved Threads: 12
 

Is there any POST example for me?

I'll also read about CURL while waiting.

Thanks

veledrom
Master Poster
758 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

Form on www.111.com/form.html

<form action="http://www.222.com/process.php" method="post">
  <!-- rest of form here -->
</form>
kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

I have downloaded curl and ream the installation for win and ubuntu. However, i didn't get it. Is there any source where it is explained step by step?

thanks

veledrom
Master Poster
758 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

Hi,

Why to get the CURL Library individually and install it.. You can use XAMPP/WAMP type integrated environment apps, that gives you almost everythng.. They have built in curl extensions for windows (you might have to enable it from php.ini file).

And for the CURL learning/tutorial, check out the links below.. they are good for beginners. You can switch to advanced version later on.

http://www.higherpass.com/php/Tutorials/Using-Curl-To-Query-Remote-Servers/

http://blog.unitedheroes.net/curl/

sikka_varun
Junior Poster in Training
94 posts since Dec 2008
Reputation Points: 11
Solved Threads: 12
 

For example: how do i check if username=1 and password=2 in check.php page and return TRUE or FALSE?

<?  
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://www.mysite.com/check.php'); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 
curl_setopt(CURLOPT_USERPWD, '[username]:[password]') 

$data = curl_exec(); 
curl_close($ch); 
 ?>
veledrom
Master Poster
758 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You