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

php邮件的收

php邮件读取:
程序开发的思路:mail文件:先连接到pop3,读取用户的邮件列表,判断邮件是否读取过,如果没读取过就把邮件加到中转的数据库中。get_mail()函数,读取数据库中的邮件列表,读完后对数据库进行清除。以便能一直读取的都是新的邮件。
代码程序:mail文件:
header("content-type:text/html; charset=utf-8");
include 'config.php';
include 'Pop3.php';
include 'mail_config.php';
$conn=mysql_connect($db_host,$db_user,$db_pass);
mysql_query("set names utf8");
mysql_select_db("$mail_data",$conn);
$pop3=new Net_POP3();
if ($pop3->connect($host,110)=="true"){
 $bool=$pop3->login($user,$password);
 if ($bool=="ture"){
  $list=$pop3->_cmdList();
  $sum=$pop3->_cmdStat();
  echo "<br>";
  for ($j=0;$j<$sum[0];$j++){
   $head=$pop3->getParsedHeaders($list[$j]['msg_id']);
   preg_match("/([a-z0-9A-Z\s]+):([0-9]+):([0-9]+)/",$head['Date'],$rt);
   echo "<br>";
   $int_time=strtotime($rt[0]);//时间戳 
   $from=(imap_mime_header_decode($head['from']));
   $string='';
   for ($i=0;$i<count($from);$i++){
    $string="$string".$from[$i]->text;
   }
   preg_match("/([a-z0-9A-Z_]+)@([a-z0-9A-Z\.]+).([a-z0-9A-Z]+)/",$string,$rg);
   $subject=imap_mime_header_decode($head['Subject']);
   $title='';
   for ($i=0;$i<count($subject);$i++){
    $title="$title".$subject[$i]->text;
   }
   $title=iconv("GB2312","UTF-8",$title);
   //判断邮件是否存在,备份邮件
   $sql_time="SELECT * from $mail_table_all WHERE timestamp=$int_time";
   mysql_query($sql_time)or die(mysql_error());
   
   if (mysql_affected_rows()==0){
    $sql="INSERT


相关文档:

PHP中的魔术方法

PHP中有下列称之为魔术方法(magic method)的函数:__construct, __destruct ,
__call, __callStatic,__get, __set, __isset, __unset , __sleep, __wakeup,
__toString, __set_state, __clone and __autoload,本文使用__call为实现一个身份验证的简单实例,代码如下: 代码<?php
    interfa ......

IIS6.0+PHP+MYSQL配置

Win2003server 下架设PHPWind产品环境
安装前准备:1、安装好iis6
            
             
            
&nbs ......

php生成excel

excel这类文件其实就是特殊格式的文本文件(应该所有格式都是特殊格式的文本文件和二进制文件),
excel不同的行体现在文本中的换行,里面的需要转义的字符包括,\和\r\n这两个,遇到这些字符的时候这个单元格需要用""格开 ......

php 连接数据库的类

<?php
class Access//Access数据库操作类
{
var $databasepath,$constr,$dbusername,$dbpassword,$link;//类的属性
function Access($databasepath,$dbusername,$dbpassword)//构造函数
{
$this->databasepath=$databasepath;
$this->username=$d ......

PHP环境搭建

http://www.521000.com/bbs/dispbbs.asp?BoardID=9&ID=1236357
PHP环境搭建
Apache的安装与配置
一、Apache的安装
1.从Apache的官方网站下载安装软件:http://httpd.apache.org/download.cgi,目前的最新版本是apache_2.2.11-win32-x86-no_ssl.msi。
2.打开我的电脑,进入D盘,在其下新建一个文件夹,名为 loca ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号