您可以使用cURL或套接字重新发布数据,但您无法真正重定向它.
使用cURL POST到URL:
$ch = curl_init('http://www.somewhere.com/that/receives/postdata.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
Run Code Online (Sandbox Code Playgroud)
RewriteRule current-page.php http://www.newserver.com/newpage.php [NC,P]
Run Code Online (Sandbox Code Playgroud)
那里的P(代理)将保留POST数据.如果尚未启用apache代理模块,则需要打开它.
| 归档时间: |
|
| 查看次数: |
11168 次 |
| 最近记录: |