phpÎļþÉÏ´«¼òµ¥Ê¾Àý
<?php
/*
Å׸öש£¬¾ßÌåÒª×ö³ÉʲôÑù×Ô¼º×ö¡£
*/
if(isset($_FILES['userfile']['tmp_name'])){
$userfile = $_FILES['userfile']['tmp_name']; //±£´æÔÚϵͳµÄÁÙʱλÖÃ
$userfile_name = $_FILES['userfile']['name'];//ÎļþÃû
$userfile_size = $_FILES['userfile']['size'];//Îļþ´óС£¬×Ö½Ú
$userfile_type = $_FILES['userfile']['type'];//ÎļþÀàÐÍ
if(!is_dir("image")) mkdir ("image", 0700);
$upfile = "image/".$userfile_name;//±£´æλÖÃ
print_r($_FILES);
//move_uploaded_file($userfile,$upfile);//·½·¨1
if(!copy($userfile,$upfile))//·½·¨2
{
echo "ÉÏ´«Ê§°Ü";
exit();
}
echo "ÉÏ´«³É¹¦";
echo "<a href=\"#\" onClick=\"window.history.back();\">ÔÙÉÏ´«Ò»ÕÅ</a>";
}
else{
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ÎÞ±êÌâÎĵµ</title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="MAX_FILE_SIZE" type="hidden" id="MAX_FILE_SIZE" value="1000">
<input name="userfile" type="file" id="userfile">
<input type="submit" name="Submit" value="ÉÏ´«">
</form>
</body>
</html>
<?php }?>
http://blog.chinaunix.net/u/24375/showart_187025.html
Ïà¹ØÎĵµ£º
PHP: echo substr("1234567", 1, 3);
ºÍ PHP: echo substr(123456,1, 3);
ÊÇÒ»ÑùµÄ
¶¨Òå
Ò»°ãÓÃË«ÒýºÅ»òµ¥ÒýºÅ±êʶһ¸ö×Ö·û´®¡£±ÈÈç PHP: $str = "i love u";
$str = 'i love u';
ËüÕßÁ½ÕßÊÇÓÐһЩÇø±ðµÄ¡£ºóÕß½«Ò»Çе¥ÒýºÅµÄÄÚÈݶ¼»áµ±×÷×Ö·û´¦Àí£»Ç°ÕßÔ ......
ÕûÁË°ëÌì¿ÉËãÈÃÎÒÕû³öÀ´ÁË º¹°¡£¡
C:\xampp\apache\conf\http.conf ÅäÖÃ
<Directory />
Options FollowSymLinks
AllowOverride all
Order deny,allow
# Deny from all
</Directory>
н¨ÏîÄ¿myphp
ÐéÄâ»ú·¾¶ localhost ......
ÓÉÓÚ×î½ü×öµÄÒ»¸öÏîĿͼƬ±È½Ï¶à£¨ËõÂÔͼ+ʵ¼ÊÎïƷͼ£©£¬´ó¸ÅÓÐÒ»Íò¶à¸öÎļþ£¬¶ø·þÎñÆ÷ÓÖÔÚ¹úÍ⣬ÓÃÃÀ¹úµÄVPNËٶȻ¹ÊǷdz£µÄÂý£¬Èç¹ûÉÏ´«Ò»Íò¶à¸öÎļþ£¬¹À¼Æ½«»¨·ÑÁ½Èý¸öСʱ¡£²¢ÇÒÓÉÓÚºóÃ潫Óиü¶àµÄÎļþÐèÒªÉÏ´«ÖÁ·þÎñÆ÷£¬ËùÒÔºÝÏÂÐÄÀ´ÕÒÒ»ÖÖÉÏ´«Ñ¹Ëõ°üºó½øÐд¦ÀíµÄ·½·¨¡£ & ......
ѧϰĿµÄ£ºÑ§»áSESSIONµÄʹÓÃ
¡¡¡¡SESSIONµÄ×÷Óúܶ࣬×î¶àÓõľÍÊÇÕ¾µãÄÚÒ³Ãæ¼ä±äÁ¿´«µÝ¡£ÔÚÒ³Ã濪ʼÎÒÃÇÒªsession_start();¿ªÆôSESSION£»
¡¡¡¡
¡¡¡¡È»ºó¾Í¿ÉÒÔʹÓÃSESSION±äÁ¿ÁË£¬±ÈÈç˵Ҫ¸³Öµ¾ÍÊÇ£º$_SESSION['item']="item1";ÒªµÃµ½Öµ¾ÍÊÇ$item1=$_SESSION['item'];£¬ºÜ¼òµ¥°É¡£ÕâÀïÎÒÃÇ¿ÉÄÜ»áʹÓõ½Ò»Ð©º¯Êý£¬±ÈÈçË ......
ѧϰĿµÄ£ºÑ§»áÓÃPHPÉÏ´«ÎļþºÍ·¢Óʼþ
¡¡¡¡ÉÏ´«Îļþ±íµ¥±ØÐë¼ÓÉÏ enctype="multipart/form-data" ºÍ <input type="file" name="file">
¡¡¡¡
¡¡¡¡ÏÂÃ濴һϴúÂ룺
¡¡¡¡$f=&$HTTP_POST_FILES['file'];
¡¡¡¡$dest_dir='uploads';//É趨ÉÏ´«Ä¿Â¼
¡¡¡¡$dest=$dest_dir.'/'.date("ymd")."_".$f['name'];// ......