PHP邮件收发,和编码问题。数据匹配
<?php
header("content-type:text/html; charset=UTF-8");
/*
* record kid words and insert into database
* user by sending email to publication kid words
*
*/
include 'POP3.php';
include 'email_class.php';
include 'Mail_mimeDecode.php';
//include 'include/compatible.php';
include 'include/extend_common.php';
//include '../../htdocs/include/extend_common.php';
define('POST_from_EMAIL', 1);
define('DATABASE_CONNECTION_ERROR', 2);//数据库连接失败错误
define('EMAIL_CONNECTION_ERROR', 3);//邮箱连接失败错误
define('ACCOUNT_ERROR', 4);//邮箱的账号错误
define('SIGN_EMAIL_ERROR', 5);//邮件标记删除错误
define('DELELET_ERROR', 6);//删除邮件错误
define('INSERT_ERROR', 7);//插入数据失败错误
class mail_data {
function mail_data(){
include 'config.php';
$mail_log=fopen("mail_log.txt","a+");
$conn=@mysql_connect($db_host,$db_user,$db_password);
if($conn){
mysql_select_db('t',$conn);
mysql_query("set names utf8");
$pop3=new Net_POP3();
//判断连接是否成功
if ($pop3->connect($host,110)){
//判断登入是否成功
if($pop3->login($user,$password)===true){
$list=$pop3->_cmdList();
$sum=$pop3->_cmdStat();
//每次取多少邮件
$step=2;
$r=0;
//先对邮箱取$step邮件
for($n=0;$n<$sum[0];$n+=$step){
$t=0;
$users=array();
$mail=array();
$offset=($sum[0]-$n)<$step?
相关文档:
PHP中有下列称之为魔术方法(magic method)的函数:__construct, __destruct ,
__call, __callStatic,__get, __set, __isset, __unset , __sleep, __wakeup,
__toString, __set_state, __clone and __autoload,本文使用__call为实现一个身份验证的简单实例,代码如下: 代码<?php
interfa ......
Win2003server 下架设PHPWind产品环境
安装前准备:1、安装好iis6
&nbs ......
<?php
// 将数组转换成Json格式,中文需要进行URL编码处理
function Array2Json($array) {
arrayRecursive($array, 'urlencode', true);
$json = json_encode($array);
$json = urldecode($json);
// ext需要不带引号的bool类型
&n ......
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 ......