Laien's

成功 自在 健康 好状态

Archive for the ‘PHP’ tag

【原创】PHP Socket编程学习

without comments

PHP Socket编程学习——做个简单的shell,监听本地1984端口。

?Download download.txt
1
2
3
4
5
6
7
8
< ?php
 
/**
 * @author laien
 * @copyright 2008
 * @Description PHP Socket编程学习
 */
?>

Read the rest of this entry »

Written by Laien

October 20th, 2010 at 2:28 pm

Posted in PHP,Programming

Tagged with ,

【原创】PHP实现foxmail邮箱中转站文件批量自动续期

without comments

?Download download.txt
1
2
3
4
5
6
7
8
9
10
/**
 * PHP实现foxmail邮箱中转站文件批量自动续期 shadu###foxmail.com 2009-03-28 23:45
 * 1、GET获取随机字符串生成密码加密串45szrPE9YhuE6BQghSBkkVsRXEKAjnGl40877739
 * 2、POST登录验证,获取邮件服务器地址m20.foxmail.com/cgi-bin/...+...
 * 3、GET跳转至邮件服务器http://m20.foxmail.com/cgi-bin/frame_html?sid=NTI1Mjk4MTc1ODI5ODgzMDIw2287898,zh_CN
 * 4、GET进入文件中转站exs_files?sid=NTI1Mjk4MTc1ODI5ODgzMDIw2287898,zh_CN&loc=folderlist,,,34
 * 5、提取文件中转站所有文件列表
 * 6、POST文件批量续期
 * 7、后附Foxmail安全登陆安全密码算法
 */

Read the rest of this entry »

Written by Laien

October 20th, 2010 at 2:20 pm

Posted in PHP,Programming

Tagged with ,

【原创】PHP实现网站打包为XML的类(加强版)

without comments

经常在自己电脑和虚拟主机之间上传下载网页文件。文件上传使用FTP命令一条一条执行效率还是很低的。我写了个网站文件和XML文件互相转换的类,发布出来方便大家使用。 之所以使用XML而不是ZIP是有原因的:1、XML文件方便其他程序调用,特别是全能空间;2、使用ASP打包ZIP我还不会。 过几天我再发布一个ASP版的WEB2XML的类。哪位朋友对asp.net、jsp等熟悉,可以帮忙一起实现这个全能的WEB2XML。

2009/05/22 00:07:
修正了一个Bug:空文件夹不能打包。
增加了一个功能:打包前文件过滤。
增加了扩展字段:md5校验值、文件大小、文件夹数目、文件数目等。

Read the rest of this entry »

Written by Laien

October 20th, 2010 at 2:16 pm

Posted in PHP,Programming

Tagged with , ,

【原创】PHP实现了的SYSLOG Sender

without comments

工作需要,用PHP实现了一个SYSLOG Sender。支持IP、端口自定义。
下一个版本将支持协议、重复次数、类型和优先级等自定义。
Read the rest of this entry »

Written by Laien

October 20th, 2010 at 2:09 pm

Posted in PHP,Programming

Tagged with , , ,

【原创】PHP操作CSV文件一例

without comments

?Download download.txt
1
2
3
4
5
/**
 * 将csv文件导入数据库
 *
 * @param string csv_file_name
 */

Read the rest of this entry »

Written by Laien

October 20th, 2010 at 2:01 pm

Posted in PHP,Programming

Tagged with , ,

【原创】PHP连接远程Oracle数据库的总结

without comments

关于PHP连接远程Oracle的总结:
1、安装instantclient-basic-win32-10.2.0.4.zip 至c:\ora
2、将c:\ora加入系统环境变量,用户环境变量等
3、php.ini启用extension=php_oci8.dll
4、php程序连接语句 $conn = oci_connect(“username”, “password”, ’192.168.254.101:1521/DZ_BBS’);
5、如果需要以特权帐户连接则就行6、7步骤
6、修改php.ini 启用 oci8.privileged_connect = 1
7、php连接语句 $conn = oci_connect(“sys”, “password”, ‘//192.168.254.101:1521/DZ_BBS’, NULL,OCI_SYSDBA);

?Download download.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
/**
 * @Oracle 连接测试
 */
$conn   = oci_connect("username", "password", '192.168.254.101/DZ_BBS');
//$conn   = oci_connect("sys", "password", '192.168.254.101:1521/ARCSIGHT', NULL,OCI_SYSDBA);
$stmt  = oci_parse($conn, "select * from DZ_BBS.USERS");
oci_execute($stmt, OCI_DEFAULT);
  echo $conn."----selecting\n\n";
  while (oci_fetch($stmt)) {
    echo $conn . " [" . oci_result($stmt, "ID") . "]\n\n";
  }
 echo $conn . "----done\n\n";
?>

Written by Laien

October 20th, 2010 at 1:52 pm

Posted in PHP

Tagged with , ,

【原创】PHP飞信发送类的修正(感谢jjchibin)

without comments

  由于我测试验证不严谨,导致上次发布的PHP飞信短信发送类只能给自己发短信,无法给其他飞信好友发送短信。向各位表示抱歉,同时我今天修改了这个问题。关键是两个步骤:1、登录成功后GetContactList获取用户列表,2、GetContactsInfo获取用户详细信息,建立手机号码和飞信sip的uri之间的映射关系。
  多的不说了,直接贴代码。经测试程序可以群发,单发,给自己发!
  点击下载PHP飞信发送类修正版
Read the rest of this entry »

Written by Laien

March 3rd, 2010 at 2:47 pm

Posted in PHP,Programming

Tagged with , ,