ÎÒµÄ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
Ïà¹ØÎĵµ£º
function file_list($path) {
$handle = opendir($path);
if ($handle) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (is_dir($path."/".$file)) {
echo "<br /><br /><b> ......
1£º apache·þÎñÆ÷°²×°.apache_2.0.59-win32-x86-no_ssl.msi¡£
ÐÞ¸Äconf\httpd.confÖеÄÎļþ£¬ÐÞ¸ÄλÖÃΪ£º
DocumentRoot "c:/webpage" ÉèÖÃÐéÄâĿ¼ c:/webpage.
DirectoryIndex index.html index.html.var index.php
==ʹapache·þÎñÆ÷ʶ±ðphpµÄÀ©Õ¹Ãû¡£
ÔÚ<Directory "c:/pr ......
<?php
//ÉùÃ÷Êý×é±äÁ¿
$arr = array('ÕÅÈý','ÀîËÄ','ÍõÎå','ÀîÃ÷');
//foreachÑ»·±éÀúÊý×é
foreach($arr as $value){
//×¢Òâ“$value”ºó±ØÐëÒªÒ»¸ö¿Õ¸ñ£¬·ñÔòÊä³öµÄ½á¹û²»ÕýÈ·
echo "$value<br/>";
}
?> ......
£Ûת×Ô£Ýhttp://hi.baidu.com/xiamishule/blog/item/dea92c09ef9acc9e0b7b8236.html
Ô´´úÂ룺
PHP»ñÈ¡IPµÄ·½·¨ÓÐÐí¶àÖÖ£¬<br />½ñÌìÏò´ó¼Ò×ܽáÁËÁùÖÖ·½·¨¡£
<br />PHP»ñÈ¡IP·½·¨Ò»£º
<?php
function GetIP() {
if(!empty($_SERVER["HTTP_CLIENT_ ......
³ÌÐò·Ç×èÈûģʽ£¬ÕâÀïÒ²¿ÉÒÔÀí½â³É²¢·¢¡£¶ø²¢·¢ÓÖÔÝÇÒ¿ÉÒÔ·ÖÎªÍøÂçÇëÇó²¢·¢
ºÍ±¾µØ²¢·¢
¡£
ÏÈ˵һÏÂÍøÂçÇëÇó²¢·¢
ÀíÂÛÃèÊö
¼ÙÉèÓÐÒ»¸öclient£¬³ÌÐòÂß¼ÊÇÒªÇëÇóÈý¸ö²»Í¬µÄserver£¬´¦Àí¸÷×ÔµÄÏìÓ¦¡£´«Í³Ä£Ð͵±È»ÊÇ˳ÐòÖ´ÐУ¬ÏÈ·¢Ë͵ÚÒ»¸öÇëÇ󣬵ȴýÊÕµ½ÏìÓ¦Êý¾ÝºóÔÙ·¢Ë͵ڶþ¸öÇëÇó£¬ÒÔ´ËÀàÍÆ¡£¾ÍÏñÊǵ¥ºËCPU£¬Ò»´ÎÖ»ÄÜ´ ......