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

ÎÒµÄphpµÄѧϰ

<?
class upload{
private $name;                 //$_FILES['file'][name]
private $type;                 //$_FILES['file'][type]
private $tmp_name;             //$_FILES['file'][tmp_name]
private $error;                //$_FILES['file'][error]
private $size;                 //$_FILES['file'][size]
private $newf;                 //ÎļþÉÏ´«Â·¾¶ ĬÈÏΪ  upload/
 public function __construct($name,$type,$tmp_name,$error,$size,$newf="upload/"){
 $this->name=$name;
 $this->type=$type;
 $this->tmp_name=$tmp_name;
 $this->error=$error;
 $this->size=$size;
 $this->newf=$newf;
 }
 private function size(){      //ÉÏ´«´óС
  if($this->size>(1024*1024)){ //ĬÈÏΪ 1MB
  echo "<script>alert('ÄúÉÏ´«ÎļþÌ«´óÁË,²»ÄÜÉÏ´«£¡');history.back();</script>";
  
  exit();
  }
 }
 private function type(){ //Ö§³ÖÉÏ´«ÀàÐÍ
  switch    ($this->type)
  {
  case    "image/pjpeg":
  break;
  case    "image/gif":
  break;
  case    "image/x-png":
  break;
  case    "application/x-shockwave-flash":  //swf
  break;
  case    "text/plain": //text
  break;
  case    "application/msword": //doc
  break;
&nb


Ïà¹ØÎĵµ£º

php»ù´¡Ó¦ÓãºphpÅúÁ¿×ª»»Îļþ±àÂë

±éÀúĿ¼Îļþ£¬Ìæ»»±àÂ벿·Ö£¬É¾³ýÔ­Îļþ£¬ÔÙÖØÐÂתÂëÔ­ÎļþÄÚÈÝ£¬ÖØÐÂÉú³ÉÐÂÎļþ¡£
function explorerdir($sDir){

static $aTempArr=array();
$dp=opendir($sDir);
while ($sFileName = readdir($dp)){

if ($sFileName !='.' && $sFileName !='..'){

......

PHP³öÏÖWarning:Illegal offset type in

Warning
: Illegal offset type in
Warning
: Illegal offset type in isset or
empty in
Ç°¼¸Ììд³ÌÐòµÄʱºòÅöµ½Ò»¸öÕâÖÖ´íÎóÌáʾ
Èç¹ûÄãʹÓÃÕâÑùµÄ±íʾ·½·¨ÈçÏ£º
$arr = array();
class a
{
}
$o = new a;
echo $arr[$o];
¾Í»á³öÏÖÉÏÃæµÄ´íÎóÌáʾ£¬ÒòΪ²»ÄÜʹÓÃʵÀý»¯µÄ¶ÔÏóÀ´×÷ΪÊý×éµÄË÷Òý£¬»òÕßÔÚʹÓÃi ......

PHPÖÐÈçºÎ¸üÐÂÊý×é

Ô­ÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/20100410/55.html
ÔÚPHPÖиüÐÂÊý×éµÄÄÚÈÝ¿ÉÒÔÖ±½ÓÖ¸¶¨¼üÃû²¢ÇҶԸüüÃû¸³Öµ¡£ ÀýÈ磺
 <?php
 $php = array(“php”,”phpdo”,”phpdo.net”);
 $php[2] = “www.phpdo.net”;
 print_r($php);
&nbs ......

php mysql ²ÉÓà utf 8 µÄÅäÖÃ

1¡¢ÔÚÅäÖÃmysqlʵÀýµÄÓïÑÔÑ¡Ïîʱ£¬Ñ¡Ôñutf-8
2¡¢ÔÚhtml,phpÒ³ÃæÖÐ ¼ÓÉÏ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />£¬Èç¹û²»ÐÐÔÙÔÚ phpÎļþ Æðʼ´¦¼Ó header("Content-Type:text/html;charset=utf-8");
3¡¢ÔÚphpÖÐ×öÊý¾Ý¿âÁ¬½Óʱ£¬ÎÒÓõÄʱpdoµÄÐÎʽ£¬Ë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ