请问高手:表单(form)提交的底层操作 下载下面任意一个类,即可使用php实现post数据,注意服务器必须支持socket库。1、http://www.phpclasses.org/browse/package/375.html2、http://www.phpclasses.org/browse/package/1119.html 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php/* Send POST request to https://secure.example.com/form_action.php* Include form elements named "foo" and "bar" with dummy values*/$sock = fsockopen("ssl://secure.example.com", 443, $errno, $errstr, 30);if (!$sock) die("$errstr ($errno)\n");$data = "foo=" . urlencode("Value for Foo") . "&bar=" . urlencode("Value for Bar");fputs($sock, "POST /form_action.php HTTP/1.0\r\n");fputs($sock, "Host: secure.example.com\r\n");fputs($sock, "Content-type: application/x-www-form-urlencoded\r\n");fputs($sock, "Content-length: " . strlen($data) . "\r\n");fputs($sock, "Accept: */*\r\n");fputs($sock, "\r\n");fputs($sock, "$data\r\n");fputs($sock, "\r\n");$headers = "";while ($str = trim(fgets($sock, 4096))) $headers .= "$str\n";echo "\n";$body = "";while (!feof($sock)) $body .= fgets($sock, 4096);fclose($sock);?> 应该是封装成http报头吧,我猜的你找些http协议方面的资料看看帮你up 万分感谢众位,尤其是hahawen(变态的大龄青年) ,谢谢我验证成功就给分! 那如果用ASP呢,是不是无法实现? 求用php打开本地exe文件的方法 url重写想把任意前缀.XIAOZ.COM转向www,但是不影响IP和localhost 菜鸟求个代码 php5 bg2312 utf-8 转换问题 coreseek里not in 和 关键词为空怎么处理? 大家现在在用哪些版本的Mysql啊?4.0 4.1 5.0? 查询的问题 请把我看看问题在那里? 超简单的php程序!可是报错! fwrite()函数问题,请朋友们赐教 【求助】使用php如何向Server发送登录请求? 我是php程序运行时出现了这样的结果 请各位帮忙看一下出了什么问题
/* Send POST request to https://secure.example.com/form_action.php
* Include form elements named "foo" and "bar" with dummy values
*/$sock = fsockopen("ssl://secure.example.com", 443, $errno, $errstr, 30);
if (!$sock) die("$errstr ($errno)\n");$data = "foo=" . urlencode("Value for Foo") . "&bar=" . urlencode("Value for Bar");fputs($sock, "POST /form_action.php HTTP/1.0\r\n");
fputs($sock, "Host: secure.example.com\r\n");
fputs($sock, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($sock, "Content-length: " . strlen($data) . "\r\n");
fputs($sock, "Accept: */*\r\n");
fputs($sock, "\r\n");
fputs($sock, "$data\r\n");
fputs($sock, "\r\n");$headers = "";
while ($str = trim(fgets($sock, 4096)))
$headers .= "$str\n";echo "\n";$body = "";
while (!feof($sock))
$body .= fgets($sock, 4096);fclose($sock);
?>
你找些http协议方面的资料看看
帮你up
我验证成功就给分!