Home  >  Article  >  php教程  >  php中利用post传递字符串重定向的实现代码

php中利用post传递字符串重定向的实现代码

WBOY
WBOYOriginal
2016-06-06 20:36:421362browse

php中利用post传递字符串重定向的实现代码,需要的朋友可以参考下。

代码如下:
$ch = curl_init('http://domain-name.com/page.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "FORM_ID=295&NAME=$_POST[NAME]&EMAIL=$_POST[EMAIL]&PHONE=$_POST[PHONE]&DESCRIPTION=$_POST[DESCRIPTION]");
curl_exec($ch);
curl_close($ch);
exit;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn