guiags
Posts: 29
|
| Posted: 03/28/2011, 6:04 AM |
|
Hello, please can you assist with a small scripting question : I´m trying without success to collect data with « POST » from another server and my server is in https, and the data collection does not work.
Example:
I want to retrieve values submitted from the website of the seller by a buyer. My website is in https and i need those data to validate the transaction.
After the submission of the buyer from the website of the seller, the global variable $_POST reaches on my website empty.
PS: Datas are submitted from the website of the seller to my website (because the validation of the transaction is made by one of my scripts)
Thanks
|
 |
 |
Gena
Posts: 591
|
| Posted: 03/28/2011, 6:37 AM |
|
look at CCGetFromPost Function
also your php file should be like this
<?
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "XXXXX.php"); // your PHP filename here!!
include(RelativePath . "/Common.php");
$order = CCGetParam("order","");
//or
$order = CCGetFromPost("order","");
?>
_________________
Gena |
 |
 |
guiags
Posts: 29
|
| Posted: 03/28/2011, 7:33 AM |
|
Hi !
please this answer don't solve my problem. If all the operations where on the same server, it would walk but in my case, operations are between 2 differents servers.
Example:
1- SERVER 1 post datas toward SERVER 2
2- SERVER 2 is suppose to retrieve values sent by SERVER 1 but on SERVER 2, $_POST is empty (my website is on SERVER 2).
So how can i retrieve those values sent by SERVER 1 ?
Thanks
|
 |
 |
datadoit
|
| Posted: 03/28/2011, 8:24 AM |
|
You're going to have to send the post values as parameters in the URL,
and the receiving server script will have to know how to deal with the
parameters to make the post.
I'm not aware of any method to remote post a form's content. Can you
imagine what our internet world would be like if that were possible?
It'd be chaos! :) That's why we use API's, Http/XML/JSON
Request/Response, etc.
|
|
|
 |
guiags
Posts: 29
|
| Posted: 03/28/2011, 10:11 AM |
|
Datadoit, i think it is possible. May be because of my level in english you don't get the problem very well.
I take another example to illustrate what i want to do:
On eCommerce website, we generally have this process:
Merchant's website (the buyer proceed to the paiement)---->Paypal---->Merchant's website with the confirmation of the transaction.
My question: How paypal and the other payment gateway proceed to retrieve the values submitted (by POST) by the buyer?
Thanks
|
 |
 |
damian
Posts: 838
|
| Posted: 03/28/2011, 2:20 PM |
|
server1 must send a request to server2 eg:https://server2/page.php?param1=xxx¶m2=yyyy
server2 does not retrive values from server1 - only from the page/request that server1 sends...
i hope that makes sense
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
guiags
Posts: 29
|
| Posted: 03/29/2011, 3:01 AM |
|
Hi Damien!
the answer you give is suppose to walk but the problem is that datas sent by server 1 to server 2 cannot be in the url because they are very private.
I checked API of many payment gateway and i saw that they always use method "POST" because there is a problem of security with "GET".
Now i want to make my own API for my payment gateway and i don't know how to retrieve values posted by the buyer.
Please help me
Thanks
|
 |
 |
datadoit
|
| Posted: 03/29/2011, 11:38 AM |
|
You have to understand that you're still sending URL parameters to that
POST location, not your server's $_POST values. Again, that would be
very very very bad for one web server to directly post to another web
server. You're posting to a file on a remote server, along with
parameters for that file to process.
Now there are many ways to encrypt the sent data and to unencrypt the
response, one of which is to use PHP's cURL.
When you send data to a payment gateway such as PayPal or Authorize.Net,
you're sending to their API key value pairs, or URL parameters. The
very simplest way for you to send your data to a remote server from
CodeCharge is to create a search form, and set the Return Page to that
of the remote server's page. A more secure and robust way would be to
use cURL.
|
|
|
 |
damian
Posts: 838
|
| Posted: 03/30/2011, 4:15 AM |
|
wouldnt the simplest way be just to use https/ssl? isnt that going to encrypt your data?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
guiags
Posts: 29
|
| Posted: 03/30/2011, 10:22 AM |
|
Hi !
Datadoit, i understand what you explain and i thank you for that but it didn't solve my problem.
The problem is not "how to send data to a remote server" but "how to retrieve data coming from a remote server". For example, if my script is on a server, how can i do (or how can i use CURL) to retrieve values posted (sent) by a form situated on a remote server
Please i need your help; this situation will kill me
Thanks
|
 |
 |
datadoit
|
| Posted: 03/30/2011, 10:31 AM |
|
Well, you're beyond the scope of the forum, and more into a call for
paid assistance to create you a custom API (application programming
interface).
Post to the jobs-available forum for assistance and I'm sure many on
here would be happy to provide paid support. Yes Software also provides
custom programming support at a very competitive rate.
http://www.yessoftware.com/purchase/product.php?product_id=1&
|
|
|
 |