2

This is the code:

header("Location: checkout/transactionCompleted.php?id=".$transactionId);

Then I use $_GET['id'] to get the value. So far so good.

Question: How can I do that by POSTING the variable instead and without using session??

Thanks,

George

Ben G
  • 26,091
  • 34
  • 103
  • 170
yorgos
  • 1,730
  • 5
  • 20
  • 28

2 Answers2

3
$post_data = 'id='.$transactionId;
$content_length = strlen($post_data);

header('POST checkout/transactionCompleted.php');
header('Host: localhost');
header('Connection: close');
header('Content-type: application/x-www-form-urlencoded');
header('Content-length: ' . $content_length);
header('');
header($post_data);
gdub
  • 191
  • 4
1
$http_request  = "POST $path HTTP/1.0\r\n";
$http_request .= "Host: $host\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
$http_request .= "Content-Length: " . strlen($req) . "\r\n";
$http_request .= $req;

I think that you have to fill such form, and then send it.

therealszaka
  • 453
  • 4
  • 20