您好,欢迎访问一九零五行业门户网

关于POST方式传递数据的有关问题

关于post方式传递数据的问题
最近在研究怎么用post方式传递数据
我想得到的效果是,打开网页a,向一个网页b传递一个字符串
然后在网页b上显示这个字符串。
在网上找到一份代码,是这样的
网页a的代码:
 'tanteng' 
// 'password' => 'password'
);
$ch = curl_init ();
// print_r($ch);
curl_setopt ( $ch, curlopt_url, $uri );
curl_setopt ( $ch, curlopt_post, 1 );
curl_setopt ( $ch, curlopt_header, 0 );
curl_setopt ( $ch, curlopt_returntransfer, 1 );
curl_setopt ( $ch, curlopt_postfields, $data );
$return = curl_exec ( $ch );
curl_close ( $ch );
print_r($return);
?>
网页b的代码
在我电脑上实验的结果是打开网页b只显示  this is the posted data
而网页a上显示    您好,tanteng!
有谁能给我解释下为什么吗?如果我想让这句话在网页b上显示该怎么做?
------解决思路----------------------
可以用數據庫或文件保存。
a.php
'tanteng'
// 'password' => 'password'
);
$ch = curl_init ();
// print_r($ch);
curl_setopt ( $ch, curlopt_url, $uri );
curl_setopt ( $ch, curlopt_post, 1 );
curl_setopt ( $ch, curlopt_header, 0 );
curl_setopt ( $ch, curlopt_returntransfer, 1 );
curl_setopt ( $ch, curlopt_postfields, $data );
$return = curl_exec ( $ch );
curl_close ( $ch );
print_r($return);
?>

handle.php

b.php

其它类似信息

推荐信息