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ÖÐÓÐÏÂÁгÆ֮ΪħÊõ·½·¨(magic method)µÄº¯Êý:__construct, __destruct ,
__call, __callStatic,__get, __set, __isset, __unset , __sleep, __wakeup,
__toString, __set_state, __clone and __autoload,±¾ÎÄʹÓÃ__callΪʵÏÖÒ»¸öÉí·ÝÑéÖ¤µÄ¼òµ¥ÊµÀý£¬´úÂëÈçÏ£º ´úÂë<?php
interfa ......
define("DB_SERVER","127.0.0.1");
define("DB_PORT",3306);
define("DB_CATALOG","uab");
define("DB_USERID","root");
define("DB_PASSWORD","");
$dsn="mysql:host=".DB_SERVER.";port=".DB_PORT.";dbname=".DB_CATALOG;
self::$__PDO=new PDO($dsn, DB_USERID, DB_PASSWORD);
//support long connection
self:: ......
<?php
// ½«Êý×éת»»³ÉJson¸ñʽ£¬ÖÐÎÄÐèÒª½øÐÐURL±àÂë´¦Àí
function Array2Json($array) {
arrayRecursive($array, 'urlencode', true);
$json = json_encode($array);
$json = urldecode($json);
// extÐèÒª²»´øÒýºÅµÄboolÀàÐÍ
&n ......
PHPÊÇÒ»¸öºÜÓÅÐãµÄ¹¤¾ß£¬Ëü¿ÉÒÔ¼òµ¥£¬Ò²¿ÉÒÔ¸´ÔÓ¡£²»Ò»ÑùµÄÏîÄ¿£¬Ó¦¸ÃÓò»Ò»ÑùµÄPHP¡£
СÏîÄ¿ - ¼òµ¥¶øÖ±½ÓµÄPHP
Ò»°ã¶ÔÓÚÒ»¸ö¹¦ÄÜÒ³ÃæÔÚ20ÒÔϵÄÍøÕ¾£¬ÎÒÃÇ¿ÉÒÔÓÃÒ»¸öºÜ¼òµ¥µÄ¿ò¼Ü½á¹¹À´Ð´¡£ÔÚÕâ¸ö¹æÄ£ÉÏ£¬ÎÒ½¨ÒéÊÇʹÓñȽÏÖ±½ÓµÄÃæÏò¹ý³Ì±àÂë·½·¨£¬ÔÒòºÜ¼òµ¥£¬Ã»ÓбØÒª°ÑclassÎļþŪµÄN ¶à£¬½ ......
<?php
header("content-type:image/png");
$img=ImageCreate(100,35);
$bgcolor=ImageColorAllocate($img,0,0,0);
$red=ImageColorAllocate($img,255,0,0);
$bgcolortrans=ImageColorTransparent($img,$bgcolor);
ImageString($img,5,10,10,"PNG PHP",$red);
ImagePng($img);
ImageDestro ......