PHP·¢ËÍÓʼþ phpmailer
×î½üŪPHPÓʼþ·¢ËÍʱ£¬´ÓÍøÉÏÔØÁ˶δúÂ룬×ÜÊÇÓÐЩÎÊÌ⣬ËùÒÔ¶ÔÕâЩÎÊÌâµÄ½â¾ö×÷Ò»¸ö¼Ç¼£¬·½±ãÒÔºó²éÔÄ¡£
PHP·¢ËÍÓʼþ£º
1¡¢class.phpmailer.php Àà°üµÄ¹ÙÍøÏÂÔØ×îаæµÄphpmailerÀ࣬Ҫע²áµÄŶ¡£
2¡¢×¢Òâ¿´ÄãµÄ·¢ËÍÓÊÏäÊDz»ÊÇ¿ªÍ¨µÄSMTP·þÎñ¡£µÇ¼ÓÊÏä -> ÉèÖ㬠²é¿´ÊÇ·ñÖ§³ÖSMTP»òÊÇ·ñ¿ªÆô¡£
3¡¢ÎÊÌ⣺it is not safe to rely on the system's timezone settings.
·½·¨Ò»£ºÓÐÈË˵£¬ÐÞ¸Äphp.iniÀïµÄdate.timezone ="Asia/Shanghai"£¬¸Ä±äʱÇøΪϵͳʱÇø¡£µ«ÎÒÊÔÑé²»ÐС£
·½·¨¶þ£ºAdd the following before the first function: date_default_timezone_set('UTC'); ÎÒÊDzÉÓÃÕâ¸ö·½·¨µÄ¡£
4¡¢SMTP Error: Could not authenticate. Õâ¸öÊÇÒòΪsmtpÑé֤ûͨ¹ý£¬¾ÍÊÇsmtp server µÄÓû§ÃûºÍÃÜÂë²»ÕýÈ·ÁË¡£ËùÒÔÈ·ÈÏÄãµÄÓû§ÃûºÍÃÜÂ룬Èç¹ûÊÔ¹ýÁ˲»ÐУ¬²»·Á°ÑÄãµÄ$mail->from¸ÄΪ¸ú·¢ËÍÓʼþµØÖ·Ò»Ö£¬¾ÍÊǸúÓû§ÃûÒ»Ö¡£ÕâÑùËüÓ¦¸Ã¾Í¾õµÃÕâÊǸö°²È«µÄÁË¡£
5¡¢Èç¹ûÄã°²×°ÁËOUT LOOKÖ®ÀàµÄÈí¼þ£¬¿ÉÒÔÏÈÓÃÕâЩÈí¼þÅäÖ㬼ìÑé³É¹¦ÁË£¬ÔÙ°ÑÅäÖðᵽ´úÂëÉÏÀ´£¬Èç¶Ë¿ÚÖ®ÀàµÄ¡£
<?php
// ÇëÇó PHPmailerÀà Îļþ
require_once("class.phpmailer.php");
date_default_timezone_set('UTC');
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.126.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "php_test@126.com"; // SMTP username
$mail->Password = "your_password"; // SMTP password
$mail->from = "php_test@126.com";
$mail->fromName = "Paul Deng";
$mail->AddAddress("php_receive@qq.com","Paul Deng");
//$mail->AddAddress("ellen@site.com"); // optional name
//$mail->AddReplyTo("info@site.com","Information");
$mail->WordWrap = 50; // set word wrap
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Flash Problem";
$mail->Body = "Hello, this is the content.";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "M
Ïà¹ØÎĵµ£º
1 ÔÚSQLÓï¾äÖпÉͨ¹ýÌí¼ÓÏÞÖÆÌõ¼þ:left(text,20)ֻȡtextÎı¾µÄÇ°20¸ö×Ö;
¡¡¡¡2 ¿ÉÒÔÓÃlimit fromRecord, RecordNum À´×÷Ϊ·ÖҳʹÓÃ,±ÈÈçlimit 0,30±íʾ´ÓµÚÒ»¸ö¼Ç¼¿ªÊ¼±éÀú30¸ö¼Í¼;
¡¡¡¡3 Á½¸ö±íµÄÁ¬½Ó¿ÉÒÔÊÇ£ºtable1 join table2 using x(xΪÁ½¸ö±íµÄ¹«¹²×Ö¶Î),»òÕßÊÇtable1 join table2 on table1.x = table2.x
¡¡¡ ......
Ò»¡¢ ×¢Èëʽ¹¥»÷µÄÀàÐÍ
¡¡¡¡¿ÉÄÜ´æÔÚÐí¶à²»Í¬ÀàÐ͵Ĺ¥»÷¶¯»ú£¬µ«ÊÇÕ§¿´ÉÏÈ¥£¬Ëƺõ´æÔÚ¸ü¶àµÄÀàÐÍ¡£ÕâÊǷdz£ÕæʵµÄ-Èç¹û¶ñÒâÓû§·¢ÏÖÁËÒ»¸öÄܹ»Ö´Ðжà¸ö²éѯµÄ°ì·¨µÄ»°¡£±¾ÎĺóÃ棬ÎÒÃÇ»á¶Ô´Ë×÷ÏêϸÌÖÂÛ¡£
¡¡¡¡Èç¹ûÄãµÄ½Å±¾ÕýÔÚÖ´ÐÐÒ»¸öSELECTÖ¸ÁÄÇô£¬¹¥»÷Õß¿ÉÒÔÇ¿ÆÈÏÔʾһ¸ö±í¸ñÖеÄÿһÐмǼ-ͨ¹ý°ÑÒ»¸öÀýÈç"1=1"Õâ ......
°²×°mysql
==================
1.yum install mysql*
2.Æô¶¯:/sbin/service mysqld start
°²×°php
=================
1.yum install php
2.²é¿´php°²×°Ä¿Â¼:whereis php
°²×°lighttpd
=================
1.yum install lighttpd
2.yum search lighttpd(¼ì²âlighttpdûÓб»°²×°µÄÒÀÀµ°ü)
3.yum install lighttpd ......
×î½üдһ¸ö¹ØÓÚ¶ÁÈ¡ÖÐÎÄÎļþÃûµÄСCASEÖÐÓöµ½Á˲»PHP²»Ö§³ÖÖÐÎÄÎļþÃûµÄÎÊÌâ
ÎҵĻ·¾³£º
WINDOWS+Appach +mysql
phpÒ³ MYSQL¾ùΪ±àÂëUTF-8
½â¾ö·½·¨ÈçÏ£º
ÔÚMYSQLÖÐÈ¡³öµÄÖÐÎÄÎļþÃûת»»Æä±àÂë
$fileName=iconv("UTF-8","GBK",$fileName); ......
ÏÈ°²×°apache http server һ·next£»
ÔÙ°²×°php£¬×¢ÒâÑ¡Ôñ Apache 2.2.x Module£»
°²×°½áÊøÒԺ󣬻¹ÐèÒªÐÞ¸Ä Apache µÄÅäÖÃÎļþ¡£Îļþ·¾¶Îª
C:\Program Files\Apache
Software Foundation\Apache2.2\conf\httpd.conf¡£
Óà Notepad ´ò¿ª
httpd.conf£¬ÔÚÎļþ×îºóÓÐÒÔ¡¡#BEGIN PHP INSTALLER EDITS - RE ......