PHP POST变量与标题 [英] php POST variable with headers

查看:106
本文介绍了PHP POST变量与标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是代码:

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

然后我使用 $ _ GET ['id'] 来获得价值。到目前为止这么好。



问题:我如何通过POSTING变量来改变而不使用session?



感谢,

George

解决方案

  $ 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);


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

解决方案

$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);

这篇关于PHP POST变量与标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆