php ͼƬÉÏ´«Àà´úÂë
<?
//http://www.jb51.net
class upLoad{
public $length; //ÏÞ¶¨Îļþ´óС
public $file; //ÅжϴËÀàÊÇÓÃÓÚͼƬÉÏ´«»¹ÊÇÎļþÉÏ´«
public $fileName; //ÎļþÃû
public $fileTemp; //ÉÏ´«ÁÙʱÎļþ
public $fileSize; //ÉÏ´«Îļþ´óС
public $error; //ÉÏ´«ÎļþÊÇ·ñÓдí,php4ûÓÐ
public $fileType; //ÉÏ´«ÎļþÀàÐÍ
public $directory; //
public $maxLen;
public $errormsg;
function __construct($length,$file=true,$directory)
{
$this->maxLen=$length;
$this->length=$length*1024;
$this->file=$file; //trueΪһ°ãÎļþ£¬falseΪͼƬµÄÅжÏ
$this->directory=$directory;
}
public function upLoadFile($fileField)
{
$this->fileName=$fileField['name'];
$this->fileTemp=$fileField['tmp_name'];
$this->error=$fileField['error'];
$this->fileType=$fileField['type'];
$this->fileSize=$fileField['size'];
$pathSign = DIRECTORY_SEPARATOR; // /
if($this->file) //Ò»°ãÎļþÉÏ´«
{
$path = $this->_isCreatedDir($this->directory);//È¡µÃ·¾¶
if($path)//http://www.jb51.net
{
$createFileType = $this->_getFileType($this->fileName);//ÉèÖÃÎļþÀà±ð
$createFileName=uniqid(rand()); //Ëæ»ú²úÉúÎļþÃû
$thisDir=$this->directory.$pathSign.$createFileName.".".$createFileType;
if(@move_uploaded_file($this->fileTemp,$thisDir)) //°ÑÁÙʱÎļþÒÆ¶¯µ½¹æ¶¨µÄ·¾¶ÏÂ
{
return $thisDir;
}
}
}else{ //ͼƬÉÏ´«
$path = $this->_isCreatedDir($this->directory);//È¡µÃ·¾¶
if($path)//·¾¶´æÔÚ//http://www.jb51.net
{
$createFileType = $this->_getFileType($this->fileName);//ÉèÖÃÎļþÀà±ð
$createFileName=uniqid(rand());
return
@move_uploaded_file($this->fileTemp,$this->directory.$pathSign.$createFileName.".".$createFileType)
? true : false;
}
}
}
public function _isBig($length,$fsize) //·µ»ØÎļþÊÇ·ñ³¬¹ý¹æ¶¨´óС
{
return $fsize>$length ? true : false;
}
public function _getFileType($fileName) //»ñµÃÎļþµÄºó׺
{
return end(explode(".",$fileName));
}
publi
Ïà¹ØÎĵµ£º
³õѧPHPµÄʱºò£¬ÎÒÃǾ³£±»PHPµÄ¾ø¶Ô·¾¶ºÍÏà¶Ô·¾¶ÅªµÄÔÎͷתÏò¡£Â·¾¶ÎÊÌâ¾³£µ¼ÖÂinclude¼°requireÃüÁî²»ÄܼÓÔØµ½Ö¸¶¨µÄÒ³
Ãæ£¬´Ó¶øµ¼ÖÂWeb³ÌÐòÔËÐдíÎó¡£±¾ÎĽ«¸ú´ó¼ÒÒ»Æð̽ÌÖÒ»ÏÂPHP·¾¶ÎÊÌâµÄ³£Óýâ¾ö·½°¸¡£
ÏÂÃæÎÒÃÇÏÈ×öÒ»¸ö¸ö¼òµ¥µÄʾÀý:
ÉÏͼÊÇÒ»¸ö¼òµ¥WebÏîÄ¿µÄ½á¹¹Í¼,ÆäÖи÷ÎļþµÄ´úÂëÈçÏÂ: ......
ÕýÔò±í´ïʽ×Ô¼ºÒ»Ö±²»ÊìϤ£¬Õâ2ÌìÔÚÍøÉÏÒ»Ö±¿´¹ØÓÚËüµÄÎÄÕ£¬×Ô¼º×ܽáÁ˼¸¸öº¯Êý¡£
1£®preg_match()
º¯ÊýÔÐÍ£ºint preg_match (string $pattern, string $content [, array
$matches])
preg_match
()º¯ÊýÔÚ$content×Ö·û´®ÖÐËÑË÷Óë$pattern¸ø³öµÄÕýÔò±í´ïʽÏàÆ¥ÅäµÄÄÚÈÝ¡£Èç¹ûÌṩÁË$matches£¬Ôò½«Æ¥Åä½á¹û·ÅÈëÆäÖС ......
ÒòΪֻÓÐiis6.0²Å´øÓÐwebÀ©Õ¹¡£¶øiis6.0ÊÇĬÈϰ²×°ÔÚwin2003µÄ¡£winxpÊDz»Äܰ²×°iis6.0µÄ¡£ÄÇÎÒÃǾÍÓÃiis5.1°É¡£
»·¾³£ºWINXP+IIS5.1
¿ªÊ¼Ö®Ç°ÇëÏÈÈ·¶¨ÄãµÄIIS°²×°ÊÇ·ñ³É¹¦£¬ÄÜ·ñͨ¹ýhttp://localhost
À´
·ÃÎÊ
Ò»¡¢Ïȵ½PHP¹Ù·½ÍøÏÂÔØ¸öphp-5.2.5-Win32.zip
£¬µã»÷ÕâÀïÁ´½Óµ½¹Ù
ÍøÏÂÔØµØÖ·
¶þ¡¢ÏÂÔØºÃÖ®ºó£¬Ö±½ÓÈ«²¿ ......
/ ok
header('HTTP/1.1 200 OK');
//ÉèÖÃÒ»¸ö404Í·:
header('HTTP/1.1 404 Not Found');
//ÉèÖõØÖ·±»ÓÀ¾ÃµÄÖØ¶¨Ïò
header('HTTP/1.1 301 Moved Permanently');
//תµ½Ò»¸öеØÖ·
header('Location: http://www.example.org/'
);
//ÎļþÑÓ³ÙתÏò:
header('Refresh: 10; url=http://www.example.org/');
print 'Y ......
#
Æô¶¯·þÎñµÄÓû§ºÍ×é
user
lighttpd lighttpd;
#
¿ª¶àÉÙ½ø³Ì
worker_processes
2;
#
´íÎóÈÕÖ¾
error_log
/data/log/nginx/nginx_error/nginx_error.log crit;
#
pid
pid
/var/run/nginx.pid;
#
Specifies
the value for maximum file descriptors t ......