您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

模拟表单提交的例子_PHP教程

2025/4/5 12:41:34发布16次查看
// simple post method
// version 1.0 by andrus (andrus@vnet.ee)
// disclaimer:
// everyone can change or use this code however and wherever they want ;)
// nb! for posting to microsoft platform webservers you may need to change newlines to
// microsoft always breaks standards ...
    // send out browser headers
    function send_headers ($fp) {
        fputs ($fp, accept: */*);
        fputs ($fp, accept-language: en);
        fputs ($fp, connection: keep-alive);
        fputs ($fp, user-agent: mozilla/4.0 (compatible; msie 5.5; windows 98));
    }
    // post data and return reply
    function post_data ($host, $url, $data) {
        $fp = @fsockopen ($host, 80, $errno, $errstr, 120);
        $ret = ;
           if (strncasecmp ($url, http://, 7) == 0) $url = substr ($url, 7);
        $p = strpos ($url, '/');
        if (empty ($p)) {
       $req = /;
        } else {
       $req = substr ($url, $p);
        }
        if ($fp) {
       fputs ($fp, post $req http/1.0);
       send_headers ($fp);
http://www.bkjia.com/phpjc/629390.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/629390.htmltecharticle?php // simple post method // version 1.0 by andrus (andrus@vnet.ee) // disclaimer: // everyone can change or use this code however and wherever they want ;) // nb! for posting to m...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product