php×Ô¶¯·¢ËÍÓʼþ
Ê×ÏÈÀ´¸ö email.class.php Àࣺ
<?php
class smtp
{
/* Public Variables */
var $smtp_port;
var $time_out;
var $host_name;
var $log_file;
var $relay_host;
var $debug;
var $auth;
var $user;
var $pass;
/* Private Variables */
var $sock;
/* Constractor */
function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass)
{
$this->debug = FALSE;
$this->smtp_port = $smtp_port;
$this->relay_host = $relay_host;
$this->time_out = 30; //is used in fsockopen()
#
$this->auth = $auth;//auth
$this->user = $user;
$this->pass = $pass;
#
$this->host_name = "localhost"; //is used in HELO command
$this->log_file ="";
$this->sock = FALSE;
}
/* Main Function */
function sendmail($to, $from, $subject = "", $body = "", $mailtype, $cc = "", $bcc = "", $additional_headers = "")
{
$header="";
$mail_from = $this->get_address($this->strip_comment($from));
$body = ereg_replace("(^|(\r\n))(\\.)", "\\1.\\3", $body);
$header .= "MIME-Version:1.0\r\n";
if($mailtype=="HTML"){
$header .= "Content-Type:text/html\r\n";
}
$header .= "To: ".$to."\r\n";
if ($cc != "") {
$header .= "Cc: ".$cc."\r\n";
}
$header .= "from: $from<".$from.">\r\n";
$header .= "Subject: ".$subject."\r\n";
$header .= $additional_headers;
$header .= "Date: ".date("r")."\r\n";
$header .= "X-Mailer:By Redhat (PHP/".phpversion().")\r\n";
list($msec, $sec) = explode(" ", microtime());
$header .= "Message-ID: <".date("YmdHis", $sec).".".($msec*1000000).".".$mail_from.">\r\n";
$TO = explode(",", $this->strip_comment($to));
if ($cc != "") {
$TO = array_merge($TO, explode(",", $this->strip_comment($cc)));
}
if ($bcc != "") {
$TO = array_merge($TO, explode(",", $this->strip_comment($bcc)));
}
$sent = TRUE;
foreach ($TO as $rcpt_to) {
$rcpt_to = $this->get_address($rcpt_to);
if (!$this->smtp_sockopen($rcpt_to)) {
$this->log_write("Error: Cannot send email to ".$rcpt_to."\n");
$sent = FALSE;
Ïà¹ØÎĵµ£º
<?php
header("content-type:image/png"); //¶¨ÒåÊä³öµÄͼÏñÀàÐÍ£»
$image=imagecreate(300,155); //н¨Í¼Ïñ£»
$bg=imagecolorallocate($image,220,40,120); &nbs ......
IISÉÏ°²×°PHP5.3µÄÍêÕû½Ì³Ì·½·¨(¼°5.3.0ÒÔºó°æ±¾µÄ·½·¨)
ÓÉÓÚPHP5.3µÄÈ«ÐÂÌØЧ¼°¸Ä½ø£¬ÔÓеÄisapi·½Ê½½âÎöPHP
½Å±¾ÒѾ²»±»Ö§³Ö£¬PHP´Ó5.3
.0ÒÔºóµÄ°æ±¾¿ªÊ¼Ê¹ÓÃ΢ÈíµÄfastcgiģʽ£¬ÕâÊÇÒ»¸ö¸üÏȽøµÄ·½Ê½£¬ÔËÐÐËٶȸü¿ì£¬¸üÎȶ¨£¡
а汾
µÄPHP5.3ͨ¹ýÒÔÍùÀÏ·½·¨ÒѾ²»ÄÜÔÚIISÉÏ°²×°ÁË£¬ÏÖÔÚ¸ø³öÔÚIISÉÏ°²×°PHP5.3ÒÔº ......
Ò»¡¢PHPº¯ÊýDate()»ñÈ¡µ±Ç°Ê±¼ä
´úÂ룺
<?php echo $showtime=date("Y-m-d H:i:s");?>
ÏÔʾµÄ¸ñʽ: Äê-ÔÂ-ÈÕ Ð¡Ê±:·ÖÖÓ:Ãë
Ïà¹Ø²ÎÊý£º
a£º"am"»òÕß"pm"
A£º"AM"»òÕß"PM"
d£º¼¸ÈÕ£¬¶þλÊý×Ö£¬Èô²»×ã¶þλÔòÇ°Ãæ²¹Á㣬Èç: "01"ÖÁ"31"
D£ºÐÇÆÚ¼¸£¬Èý¸öÓ¢ÎÄ×Öĸ£¬Èç: "Fri"
F£ºÔ·ݣ¬Ó¢ÎÄÈ«Ãû£¬Èç: "Jan ......
<div id="time" align="center">time </div>
<script language="javascript">
function time1()
{
var now,n,y,r,h,m,s;
now=new Date();
n = now.getYear();
y = now.getMonth()+1;
r = now.getDate();
h = now.getHours();
m =now.getMinutes();
s = now.getSeconds();
......
ÒÔÏÂΪʮ¸öÄ¿Ç°×îÁ÷ÐеĻùÓÚMVCÉè¼ÆģʽµÄPHP¿ò¼Ü¡£
1. Yii
YiiÊÇÒ»¸ö»ùÓÚ×é¼þµÄ¸ßÐÔÄܵÄPHPµÄ¿ò¼Ü£¬ÓÃÓÚ¿ª·¢´ó¹æÄ£WebÓ¦Óá£Yii²ÉÓÃÑϸñµÄOOP±àд£¬²¢ÓÐ×ÅÍêÉƵĿâÒýÓÃÒÔ¼°È«ÃæµÄ½Ì³Ì¡£´ÓMVC£¬DAO/ActiveRecord£¬widgets£¬caching£¬µÈ¼¶Ê½RBAC£¬Web·þÎñ£¬µ½Ö÷Ì廯£¬I18NºÍL10N£¬YiiÌṩÁ˽ñÈÕWeb 2.0Ó¦Óÿª·¢ËùÐèÒªµÄ¼¸ ......