php soap初识
打开php.ini的soap扩展
server.php
<?php
class math{
/**
* 加法
*
* @param integer $a
* @param integer $b
* @return integer
*
*/
public function add($a, $b){
return $a + $b;
}
}
$server = new SoapServer('http://localhost/math.wsdl',array('soap_version' => SOAP_1_2));
$server->setClass("math");
$server->handle();
?>
client.php
<?php
$client = new SoapClient('http://localhost/math.wsdl');
$result = $client->add(1,3);
echo $result;
?>
其中http://localhost/math.wsdl文件由zend studio生成
相关文档:
<!-- xml格式
<foo xmlns="test">
<bar attr='a'></bar>
<bar attr='b'></bar>
<bar attr='c'></bar>
</foo>
-->
<?php
$dom = new DOMDocument();
if (!$dom->load('attr.xml'))
{
echo "load books.xml failed!<br>";
re ......
一、PHP SESSION原理
我们知道,session是在服务器端保持用户会话数据的一种方法,对应的cookie是在客户端保持用户数据。HTTP协议是一种无状态协议,服
务器响应完之后就失去了与浏览器的联系,最早,Netscape将cookie引入浏览器,使得数据可以客户端跨页面交换,那么服务器是如何记住众多用户
的会话数据呢?
首先要 ......
conn.php
<?php
/*
* Created on 2010-1-6
* Author:CHAUVET
* Function:连接字符串
*/
$conn=@mysql_connect("localhost","root","")or die("连接数据库出错!");
mysql_select_db("newdb",$conn);
mysql_query("set names 'gb2312'");
function ReplaceSom ......
康盛的 authcode 函数可以说对中国的PHP界作出了重大贡献。包括康盛自己的产品,以及大部分中国使用PHP的公司都用这个函数进行加密,authcode 是使用异或运算进行加密和解密。
原理如下,假如:
加密
明文:1010 1001
密匙:1110 0011
密文:0100 1010
得出密文0100 1010,解密之需和密匙异或下就可以了
解密 ......
delphi 编写的com 对象 用php调用
的
实例
delphi:
function Tmyxml.Get_xml: WideString;
begin
Get_xml:='wo shi a lei!';
end;
function Tmyxml.Get_xmldata: WideString;
var
xmlStr:string;
begin
xmlStr := '<?xml version="1.0" & ......