易截截图软件、单文件、免安装、纯绿色、仅160KB

php接受xml和发送(post)xml

 
接收xml:
$xml = file_get_contents('php://input');
 
发送(post):
$xml_data = <xml>...</xml>";
$url = http://dest_url;
$header[] = "Content-type: text/xml";//定义content-type为xml
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
$response = curl_exec($ch);
if(curl_errno($ch))
{
    print curl_error($ch);
}
curl_close($ch);
 
或者:
$fp = fsockopen($server, 80);
fputs($fp, "POST $path HTTP/1.0\r\n");
fputs($fp, "Host: $server\r\n");
fputs($fp, "Content-Type: text/xml\r\n");
fputs($fp, "Content-Length: $contentLength\r\n");
fputs($fp, "Connection: close\r\n");
fputs($fp, "\r\n"); // all headers sent
fputs($fp, $xml_data);
$result = '';
while (!feof($fp)) {
$result .= fgets($fp, 128);
}
return $result;


相关文档:

php小笔记


<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......

PHP,替换多个文件中的文本

需求:
    需要对两个目录中的文件内容进行查找替换,两个目录查找替换的内容不一样。
    实现中注意几点:
    (1)函数递归调用,来检索子目录;
    (2)函数名可以以参数形式传递;
    (3)用?进行非贪婪匹配;
   ......

PHP网站开发方案(开发新人必读)

 一、开发成员
a)项目主管
b)页面美工
c)页面开发
d)服务端程序开发
e)系统与数据管理
f)测试与版本控制
二、 网站组开发简明流程
三、 开发工具与环境
a)服务器配置
i. WEB服务器: FreeBSD6.1+Apache2.0+PHP5.0,SVN版本控制服务(仅测试机)。
ii.数据库服务器: WIN2003 server+SQL server 2000+MySQL5.0 ......

LINUX下 httpd.conf my.cnf php.ini的位置

 
默认:
httpd.conf 在/etc/httpd/conf
my.cnf 在/etc
php.ini 在/usr/local/lib
在Unix 上,php.ini文件缺省放在/usr/local/lib上面,因为缺省的存放路径是<install-path>
/lib,但是可以在编译的时候使用--with-config-file-path参数来修改php.ini的存放位置,例如你可以使用--with-
config-file-path ......

php图片上传

 <?php
if(empty($_GET[submit]))
{
?>
<form enctype="multipart/form-data" action="<?php $_SERVER['PHP_SELF']?>?submit=1" method="post">
<input name="filename" type="file">
<input type="submit" value="确定上传">
</form>
<?php
}
else{
   ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号