执着收几个参数:如pid  title  cotent参数插入数据库

解决方案 »

  1.   

    搜索一下:PHP Web Services 入门概要 
      

  2.   

    可以看一下 soapserver 这个类:http://cn2.php.net/manual/en/class.soapserver.php
      

  3.   


    <?php
    //soapserver
    function insertSql($pid,$title,$content)
    {
    //sql insert
    if(true)
    {
    return true;
    }
    else 
    {
    return false;
    }
    }
    $server = new SoapServer(null, array('uri' => "http://test-uri/"));
    $server->addFunction('insertSql');
    $server->handle();
    ?>
    <?php 
    //soapserver
    $client = new SoapClient(null, array('location' => "http://127.0.0.1/test/csdn/soapserver.php",
    'uri' => "http://test-uri/"));
    $parm=array('pid'=>$pid,'title'=>$title,'content'=>$content);
    $client->__soapCall('insertSql',$parm);
    ?>
      

  4.   

    先写一个function 做这个
    写完后加一点点东西就是webservice了