【发布时间】:2013-09-18 13:24:22
【问题描述】:
我正在将注册与另一个网站集成。另一个网站以 json 格式将我的网站一些注册数据发布到我网站上的注册页面并预填充这些字段。我带用户完成注册,然后成功重定向回原始站点。此重定向应该以 json 格式、用户 ID 等发回一些信息。我不确定如何重新重定向并发布这些数据?我宁愿不使用 JS 表单提交。
任何帮助表示赞赏。
//After I have registered the user on my site and it is successful
if($success){
$postJsonArray = json_encode(array('success' => TRUE, 'userID' = 10));
$postUrl = 'http://thirdpartysite.php';
//somehow redirect and post this $postJsonArray to the URL
}
【问题讨论】:
-
如果您发布示例,您肯定会得到答案。
-
您可以使用javascript发布json(使用jquery更容易。您熟悉它吗?)。
标签: php json post redirect curl