Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

PHP 5.3.0 Á¬½Ómysqli³ö´íµÄ½â¾ö

½üÈÕÒò¹«Ë¾¿ª·¢ÐèÒª,ÔÚ±¾»ú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 ......

PHP ·ÖÒ³¼¼Êõ

1¡¢Ç°ÑÔ
    
·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ»Ñù×Ô
È»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£³£¶ÔÕâ¸öÎÊÌâÃþ²»×ÅÍ·Ð÷£¬Òò´ËÌصØ׫д´ËÎĶÔÕâ¸öÎÊÌâ½øÐÐÏêϸµÄ½²½â£¬Á¦ÇóÈÿ´ÍêÕâƪÎÄÕµÄÅóÓÑÔÚ¿´ÍêÒÔº ......

PclZip:Ç¿´óµÄPHPѹËõÓë½âѹËõzipÀà


PclZip¼ò½é
PclZipÊÇÒ»¸öºÜÇ¿´óµÄѹËõÓë½âѹËõzipÎļþµÄPHPÀ࣬PclZip libraryÄܹ»Ñ¹ËõÓë½âѹËõZip¸ñʽµÄѹËõµµ£¨WinZip¡¢PKZIP£©£»ÇÒÄܶԴËÀàÀ൵°¸½øÐд¦Àí£¬°üÀ¨²úÉúѹËõµµ¡¢ÁгöѹËõµµµÄÄÚÈÝÒÔ¼°½âѹËõµµ°¸µÈµÈ¡£
¼òµ¥¡¢Ò×Óá¢Ç¿´óÊÇÎÒ¶ÔËüµÄÆÀ¼Û¡£
×î½üÔÚ¿ª·¢ÎÒµÄWordpress²å¼þShareLink£¬ÔÚÕâ¹ý³ÌÖУ¬·¢ÏÖÁËPclZ ......

PHPÖг£ÓõÄ×Ö·û´®º¯Êý

¡¡PHPÖеÄ×Ö·û´®²Ù×÷¹¦ÄÜÊDZȽ϶àµÄ,ÖØÒªµÄÓÐÒÔÏÂÕâЩ:
¡¡¡¡(1)echo,print,printf,sprintf
¡¡¡¡Ç°Á½¸öº¯ÊýÊÇÊä³ö×Ö·û´®.×Ö·û´®ÖÐÈç¹ûÓбäÁ¿ÃûÔò±»Ìæ»»³ÉÆäÖµ. ºóÁ½¸öº¯ÊýÀàËÆÓÚCµÄͬÃûº¯Êý.
¡¡¡¡(2)strchr,strlen,strtok,strrchr,strrev,strstr,strtolower, strtoupper,substr,ucfirst
¡¡¡¡ÕâЩÊdz£ÓõÄ×Ö·û´®²Ù×÷º¯Êý, ......

PHPѧϰ±Ê¼Ç£¨Ê®Ììѧ»áPHP£©

Ò». 1. ǶÈë·½·¨£º »òÕß 2. Ó¦ÓÃÎļþ£º £¨1£©require("MyRequireFile.php")£º·ÅÔÚphp³ÌÐòµÄ×îÇ°Ã棬ÔÚphp³ÌÐòÖ´ÐÐÇ°ÒýÈë £¨2£©include("MyIncludeFile.php")£º·ÅÔÚÁ÷³Ì¿ØÖƵĴ¦Àí²¿·Ö£¬ÔÚÔËÐе½includeʱÔÙ¶ÁÈ¡½øÀ´ 3. ×¢ÊÍ·½·¨£º »ìºÏCºÍ»ã±à£º// £¬/* */£¬ #   4. ±äÁ¿ÀàÐÍ£º £¨1£©PHP±äÁ¿Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ