应朋友一个要求,对网上一个投票站点进行模拟投票,刷新得票数 分析如下: 1、分析页面,找出计票url 2、用php模拟连接 3、连接时保存对应session 4、用该session模拟连接该url,达到刷新票数的目的 程序如下: $address= dirname(__FILE__) ."/test.cookie"; $ch = curl_init(); //初始化 curl_setopt($ch, curlOPT_URL, $url); //设定模拟连接的URL curl_setopt($ch,curlOPT_COOKIEJAR,$address);...
curl是一个很好很强大的工具,但PHP并不自带这个类库,而且我们只是要实现POST方法,杀鸡焉用牛刀。纯PHP就能实现,还没有兼容性的问题。 这个函数是stream_context_create,有了它我们就可以非常方便地实现POST提交...
能用wget实现curl的功能吗?为什么我用wget提交http://user.dipns.com/api/?userid=51365683&userpwd=test 参数userpwd无法传递到服务器 wget 具有微软浏览器的功能吗?有什么区别? ##############脚本源码############################ #!/bin/bash #if [ `ps -ef |grep upddns|grep -v grep |wc -l` -lt 3 ] ;then /usr/bin/curl -d "`cat /etc/ddns/xml/upddns.xml`" \ http://link.dipserver.com/elink/elink.dll/ > /dev...
by
zhendehaoren
-
C/C++
-
2014-01-22 11:38:05 阅读(4802) 回复(11)
本帖最后由 minora 于 2011-06-09 10:56 编辑 大家好,我是php新手,在看手册时只看到了关于 PUT GET POST的设置方法 php的curl怎么用 MKCOL MOVE等方法呢?
我想要http返回的状态代码,用来做url死链的判断.请指教 curl -I http://www.chinaunix.com HTTP/1.1 302 Found Date: Thu, 30 Aug 2007 07:50:04 GMT Server: Apache/2.0.58 (Unix) PHP/5.2.3 Location: http://www.chinaunix.net/ Connection: close Content-Type: text/html; charset=iso-8859-1
我想做个网页,添上用户名和密码,点一下登录,就可以登录到我指定的网站上去,比如登录163,请大家给我点思路,谢谢了,用PHP做。。。 [ 本帖最后由 HonestQiao 于 2006-7-10 09:38 编辑 ]
PHP的curl实现get,post 和 cookie(几个实例) 类似于dreamhost这类主机服务商,是显示fopen的使用的。使用php的curl可以实现支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE和LDAP。curl 支持SSL证书、HTTP POST、HTTP PUT 、FTP 上传,kerberos、基于HTT格式的上传、代理、cookie、用户+口令证明、文件传送恢复、http代理通道就最常用的来说,是基于http的 get和post方法。 代码实现: 1、http的get实现 Php... 下面是代码:(转自CU) (俺是新手,高手见笑) 用法:./mycurl url #!/bin/bash ###################################################################################################### # # Script for curl to support resumable multi-part download. # url=$1 exename=`basename $0` # How many "parts" will the target file be divided into? declare -i parts=5 read -ep "Please input the target directory: " targe...
|