PHPÖÐgetenv()º¯Êý
getenv£¨£© È¡µÃϵͳµÄ»·¾³±äÁ¿£¨Ô¤¶¨Òå±äÁ¿£©
$spager=getenv('SERVER_NAME');
“PHP_SELF”
µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû£¬Óë document root Ïà¹Ø¡£¾ÙÀýÀ´Ëµ£¬ÔÚ URL µØַΪ [url]http://example.com/test.php/foo.bar[/url] µÄ½Å±¾ÖÐʹÓà $_SERVER['PHP_SELF'] ½«»áµÃµ½ /test.php/foo.bar Õâ¸ö½á¹û¡£__FILE__ ³£Á¿°üº¬µ±Ç°£¨ÀýÈç°üº¬£©ÎļþµÄ¾ø¶Ô·¾¶ºÍÎļþÃû¡£
Èç¹û PHP ÒÔÃüÁîÐз½Ê½ÔËÐУ¬¸Ã±äÁ¿ÔÚ PHP 4.3.0 ֮ǰÎÞЧ¡£
“argv”
´«µÝ¸ø¸Ã½Å±¾µÄ²ÎÊý¡£µ±½Å±¾ÔËÐÐÔÚÃüÁîÐз½Ê½Ê±£¬argv ±äÁ¿´«µÝ¸ø³ÌÐò C ÓïÑÔÑùʽµÄÃüÁîÐвÎÊý¡£µ±µ÷Óà GET ·½·¨Ê±£¬¸Ã±äÁ¿°üº¬ÇëÇóµÄÊý¾Ý¡£
“argc”
°üº¬´«µÝ¸ø³ÌÐòµÄÃüÁîÐвÎÊýµÄ¸öÊý£¨Èç¹ûÔËÐÐÔÚÃüÁîÐÐģʽ£©¡£
“GATEWAY_INTERFACE”
·þÎñÆ÷ʹÓÃµÄ CGI ¹æ·¶µÄ°æ±¾¡£ÀýÈ磬“CGI/1.1”¡£
“SERVER_NAME”
µ±Ç°ÔËÐнű¾ËùÔÚ·þÎñÆ÷Ö÷»úµÄÃû³Æ¡£Èç¹û¸Ã½Å±¾ÔËÐÐÔÚÒ»¸öÐéÄâÖ÷»úÉÏ£¬¸ÃÃû³ÆÊÇÓÉÄǸöÐéÄâÖ÷»úËùÉèÖõÄÖµ¾ö¶¨¡£
“SERVER_SOFTWARE”
·þÎñÆ÷±êʶµÄ×Ö´®£¬ÔÚÏìÓ¦ÇëÇóʱµÄÍ·ÐÅÏ¢Öиø³ö¡£
“SERVER_PROTOCOL”
ÇëÇóÒ³ÃæʱͨÐÅÐÒéµÄÃû³ÆºÍ°æ±¾¡£ÀýÈ磬“HTTP/1.0”¡£
“REQUEST_METHOD”
·ÃÎÊÒ³ÃæʱµÄÇëÇó·½·¨¡£ÀýÈ磺“GET”¡¢“HEAD”£¬“POST”£¬“PUT”¡£
×¢: Èç¹ûÇëÇóµÄ·½Ê½ÊÇ HEAD£¬PHP ½Å±¾½«ÔÚËͳöÍ·ÐÅÏ¢ºóÖÐÖ¹£¨ÕâÒâζ×ÅÔÚ²úÉúÈκÎÊä³öºó£¬²»ÔÙÓÐÊä³ö»º³å£©¡£
“REQUEST_TIME”
ÇëÇó¿ªÊ¼Ê±µÄʱ¼ä´Á¡£´Ó PHP 5.1.0 ÆðÓÐЧ¡£
“QUERY_STRING”
²éѯ£¨query£©µÄ×Ö·û´®£¨URL ÖеÚÒ»¸öÎʺŠ? Ö®ºóµÄÄÚÈÝ£©¡£
“DOCUMENT_ROOT”
µ±Ç°ÔËÐнű¾ËùÔÚµÄÎĵµ¸ùĿ¼¡£ÔÚ·þÎñÆ÷ÅäÖÃÎļþÖж¨Òå¡£
“HTTP_ACCEPT”
µ±Ç°ÇëÇóµÄ Accept: Í·ÐÅÏ¢µÄÄÚÈÝ¡£
“HTTP_ACCEPT_CHARSET”
µ±Ç°ÇëÇóµÄ Accept-Charset: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈ磺“iso-8859-1,*,utf-8”¡£
“HTTP_ACCEPT_ENCODING”
µ±Ç°ÇëÇóµÄ Accept-Encoding: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈ磺“gzip”¡£
“HTTP_ACCEPT_LANGUAGE”
µ±Ç°ÇëÇóµÄ Accept-Language: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈ磺“en”¡£
“HTTP_CONNECTION”
µ±Ç°ÇëÇóµÄ Connection: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈç£
Ïà¹ØÎĵµ£º
http://blog.csdn.net/hahawen/archive/2004/05/01/20692.aspx
Èý¡¢ÊµÏÖÄãµÄMode²ã
Model²ã£¬¾ÍÊÇMVCģʽÖеÄÊý¾Ý´¦Àí²ã£¬ÓÃÀ´½øÐÐÊý¾ÝºÍÉÌÒµÂß¼µÄ×°·â£¬½øÐÐËûµÄÉè¼ÆµÄʱºòÉè¼Æµ½Èý¸ö¸ö¸ÅÄî:
------ModelÀà¡£ÊÇʵÌåÀà¡£ÓÃÀ´±£´æÊý¾Ý¿â±í¸ñµÄÖÐÒ»Ìõ¼Ç¼µÄËùÓÐ×ֶεÄÊý¾Ý¡£²¢ÇÒ¿ÉÒÔÑéÖ¤ÕâÌõ¼Ç¼Êý¾ÝµÄÍêÕûÐÔ¡£
------ ......
ͼƬÑéÖ¤ÂëµÄÔÀíÊÇ·ÀÖ¹¶ñÒâ×¢²á£¬ÊµÏÖ·½·¨
ÑéÖ¤Â룺<input type="text" name="yanzhengma" />
<iframe src="code/middle.php" height="20px" width="65px" frameborder="0" id="chkimg" scrolling="no" style=" margin-top:5px">
</iframe>
<a href="javascript:chkimg.location.reload(); ......
ÔÚʹÓÃÉÏ´«Îļþʱ£¬½«ÉÏ´«µÄ´úÂë·â×°³ÉÀ࣬¸üÈÝÒ×·½±ã¡£
190.php
<?php
require('upload.php');
if($_POST['submit']){
$a = new Upload();
$File = $a -> uploadfile($ARG=array(
'File'=>array(
'name' => $_FILES['fileDoc']['name'], //Ô ......
* ×÷Õß: laruence(http://www.laruence.com)
* ±¾ÎĵØÖ·: http://www.laruence.com/2008/04/16/118.html
* תÔØÇë×¢Ã÷³ö´¦
´«Í³µÄB/S½á¹¹µÄÓ¦ÓóÌÐò£¬¶¼ÊDzÉÓÔ¿Í»§¶ËÀ”½áÊøÀ´ÊµÏÖ¿Í»§¶ËºÍ·þÎñÆ÷¶ËµÄÊý¾Ý½»»»¡£
±¾ÎĽ«Í¨¹ý½áºÏTicks(¿ÉÒԲο´ÎÒ ......