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

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特殊字符过滤

1、过滤标签(HTML):strip_tags()
例如:
<?php
$text = '<?php ?><p>Test paragraph.</p><!-- Comment -
-> <a href=http://topic.csdn.net/u/20090311/09/"#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";
// 允许使用<p>和<a>
echo stri ......

PHP IP函数

<?php
$start = ip2long('192.168.1.1');
$start = sprintf("%u", $start) ;
$end = ip2long('192.168.1.50');
$end = sprintf("%u", $end) ;
for ($start; $start<$end; $start++){
echo long2ip($start)."<br>";
}
?> ......

php 使用GD库生成验证码


GD库是PHP进行图象操作一个很强大的库。
先在php.ini里增加一行引用:extension=php_gd2.dll
重启apache。做一个测试页 var_dump(gd_info());输出数据表明GD库引用成功。
表单auth.html
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
< ......

php json_encode 问题解决小记

今天碰到个奇怪的问题,一个ajax页面在本地测试服务器运行一切正常,传到公网服务器上就死活说 javascript错误。
打开代码一看,是javascript的那一行使用了一个json的reponseText,DEBUG一下,原来回传是空的。
看看后台PHP,貌似没什么问题(本来以为是URL问题)然后上网搜一下,原来是PHP的json_encode函数在5.2下才有 ......

PHP提取8684公交数据

最近一年来一直在使用fedora,发现linux真是太适合我了,喜欢写程序,自己瞎倒腾,唉windows误我大好年华……
用PHP写了一段程序用于提取网页中的数据,相信搜索引擎也是差不多的想法,只不过他们数据多,算法好些,呵呵
[php]
<?php
/*
*此文件的目标是自动搜集存储8684上的深圳市公交数据
*
*由 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号