phpÎļþÉÏ´«º¯Êý
<?php
/**
+++++++++++++++++++++=+++++ÉÏ´«Í¼Æ¬++++++++++++++++++++++++++++++++++++++++
——————————————————————————————————————————————————————————————————————————————————
**/
function upload_image($key,$dir) {
$fname = $_FILES[$key]['name'];
$ftype = $_FILES[$key]['type'];
$fsize = $_FILES[$key]['size'];
$ftmpl = $_FILES[$key]['tmp_name'];
$ferror = $_FILES[$key]['error'];
$imagetype = array("image/jpeg","image/jpg","image/gif","image/pjpeg");
if($ferror==2 or $ferror==1) {
echo '<script>alert("ͼƬ¹ý´ó");history.go(-1);</script>';
exit;
}
if(!is_uploaded_file($ftmpl)){
echo '<script>alert("ÉÏ´«Í¼Æ¬Ê§°Ü£¬ÇëÉÔºóÖØÊÔ1");history.go(-1);</script>';
exit;
}
$is_true = in_array($ftype,$imagetype);
if(!$is_true) {
echo '<script>alert("ͼƬ¸ñʽ²»ÕýÈ·");history.go(-1);</script>';
exit;
}
if($fsize>2*(1024*1024)) {
echo '<script>alert("ͼƬ¹ý´ó");history.go(-1);</script>';
exit;
}
if(!file_exists($dir)) {
mkdir($dir);
}
$fn
Ïà¹ØÎĵµ£º
½üÈÕÒò¹«Ë¾¿ª·¢ÐèÒª,ÔÚ±¾»úWin7ϼÜÉèÁËApache+MySql+PHP
ËùʹÓÃPHP°æ±¾:PHP5.3.0, Ö®ºó·¢ÏÖÎÞ·¨Á¬½ÓmysqlÊý¾Ý¿â,¾ù±¨³¬Ê±´íÎó:
PHP Warning: mysqli::mysqli(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in xxx.php on line x
PHP Warni ......
1¡¢Ç°ÑÔ
·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ»Ñù×Ô
È»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£³£¶ÔÕâ¸öÎÊÌâÃþ²»×ÅÍ·Ð÷£¬Òò´ËÌصØ׫д´ËÎĶÔÕâ¸öÎÊÌâ½øÐÐÏêϸµÄ½²½â£¬Á¦ÇóÈÿ´ÍêÕâƪÎÄÕµÄÅóÓÑÔÚ¿´ÍêÒÔº ......
PclZip¼ò½é
PclZipÊÇÒ»¸öºÜÇ¿´óµÄѹËõÓë½âѹËõzipÎļþµÄPHPÀ࣬PclZip libraryÄܹ»Ñ¹ËõÓë½âѹËõZip¸ñʽµÄѹËõµµ£¨WinZip¡¢PKZIP£©£»ÇÒÄܶԴËÀàÀ൵°¸½øÐд¦Àí£¬°üÀ¨²úÉúѹËõµµ¡¢ÁгöѹËõµµµÄÄÚÈÝÒÔ¼°½âѹËõµµ°¸µÈµÈ¡£
¼òµ¥¡¢Ò×Óá¢Ç¿´óÊÇÎÒ¶ÔËüµÄÆÀ¼Û¡£
×î½üÔÚ¿ª·¢ÎÒµÄWordpress²å¼þShareLink£¬ÔÚÕâ¹ý³ÌÖУ¬·¢ÏÖÁËPclZ ......
¡¡PHPÖеÄ×Ö·û´®²Ù×÷¹¦ÄÜÊDZȽ϶àµÄ,ÖØÒªµÄÓÐÒÔÏÂÕâЩ:
¡¡¡¡(1)echo,print,printf,sprintf
¡¡¡¡Ç°Á½¸öº¯ÊýÊÇÊä³ö×Ö·û´®.×Ö·û´®ÖÐÈç¹ûÓбäÁ¿ÃûÔò±»Ìæ»»³ÉÆäÖµ. ºóÁ½¸öº¯ÊýÀàËÆÓÚCµÄͬÃûº¯Êý.
¡¡¡¡(2)strchr,strlen,strtok,strrchr,strrev,strstr,strtolower, strtoupper,substr,ucfirst
¡¡¡¡ÕâЩÊdz£ÓõÄ×Ö·û´®²Ù×÷º¯Êý, ......
Ò». 1. ǶÈë·½·¨£º »òÕß 2. Ó¦ÓÃÎļþ£º £¨1£©require("MyRequireFile.php")£º·ÅÔÚphp³ÌÐòµÄ×îÇ°Ã棬ÔÚphp³ÌÐòÖ´ÐÐÇ°ÒýÈë £¨2£©include("MyIncludeFile.php")£º·ÅÔÚÁ÷³Ì¿ØÖƵĴ¦Àí²¿·Ö£¬ÔÚÔËÐе½includeʱÔÙ¶ÁÈ¡½øÀ´ 3. ×¢ÊÍ·½·¨£º »ìºÏCºÍ»ã±à£º// £¬/* */£¬ # 4. ±äÁ¿ÀàÐÍ£º £¨1£©PHP±äÁ¿Ò ......