ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾PHP ±à³Ì£¾PHP5ÖÐÎÄÊÖ²á
PHP5ÖÐÎÄÊÖ²á

ʹÓà PHP

±¾½Ú»ã¼¯ÁËÄãÔÚд PHP ½Å±¾Ê±¿ÉÄÜÅöµ½µÄ´ó¶àÊýÆÕͨ´íÎó¡£

  1. aˆ‘aƒ3a†™a£¬€a£¬aa¡¥a»£¤a¡è„c†a»»a½•e!¡§a•a£¤cš„a•¡ãaRcš„e€šc”¡§ PHP e„šaœ¬a€‚aˆ‘a€Ža1ˆcŸ£¤e“a“aa£¬a POST a–1a3•a˜e‡a¡¥c”¡§a‘¡éi¼Ÿ
  2. aˆ‘eœ€e|aœ¡§a‰€aœ‰cš„a•a¼•a¡¤i¼ˆ'i¼‰a‰aŠ a£¬€a£¬aaa–œco¿i¼ˆ\i¼‰i¼Œa½¿aRƒa»¬a˜aˆi¼ˆ\'i¼‰i¼Œaˆ‘a|‚a½•eƒ½a¡èŸe€še¿‡a-¡êaˆ™e!¡§e¾¾a¼a£¤aRžcŽ¡ãi¼Ÿaˆ‘aŒa ¡¤a£¬Œaœ›eƒ½a¡èŸa¡ã†i¼ˆ"i¼‰e½¬a¡éaˆi¼ˆ\"i¼‰i¼Œa¡ã†i¼ˆ\i¼‰e½¬a¡éaˆi¼ˆ\\i¼‰a€‚
  3. aˆ‘a‰€aœ‰cš„i¼ˆ"i¼‰a’Œi¼ˆ'i¼‰eƒ½e¡é«a˜aˆao†i¼ˆ\"i¼‰a’Œi¼ˆ\'i¼‰i¼Œaˆ‘a|‚a½•a‰eƒ½aŽ»aŽ‰e¿™ao›a£¬a¿…e|cš„aa–œco¿i¼ŸaRƒa»¬a£¬oa»€a1ˆaŠa|‚a½•a‡ocŽ¡ãi¼Ÿ
  4. a½“aˆ‘e¿™a ¡¤aša—¶i¼Œe¾“a‡oa˜¾c¡èocš„a¬!aoa˜¡¥e”™cš„i¼š <?phpfunctionA myfunc($argument){A A A A echoA $argumentA +A 10;}$variableA =A 10;echoA "myfunc($variable)A =A "A .A myfunc($variable);?> e¿™a˜¡¥a€Ža1ˆa›žao‹i¼Ÿ
  5. a£¬‹e¡éa»¡êc a€Ža1ˆa2!aœ‰aˆ†aˆa£¬¡èe!Œa˜¾c¡èoi¼Ÿ <pre><?phpA echoA "ThisA shouldA beA theA firstA line.";A ?><?phpA echoA "ThisA shouldA showA upA afterA theA newA lineA above.";A ?></pre>
  6. aˆ‘a¾—aˆ¡ãa¶ˆa¡¥a€œWarning: Cannot send session cookie - headers already sent...a€aˆ–e€…a€œCannot add header information - headers already sent...a€a€‚
  7. aˆ‘eœ€e|c›¡¯aŽ£¤eR¿e—Re¡¥¡¤a¡À‚aŠ£¤a¡è¡¯a£¬-cš„a¿!a¡¥i¼Œa€Ža1ˆeƒ½aŠžaˆ¡ãi¼Ÿ
  8. a½“aˆ‘c”¡§ IIS e¿›e!Œ HTTP eR¡èe¡¥a—¶a¾—aˆ¡ãa€œNo Input file specifieda€a¶ˆa¡¥a€‚
  9. Windowsi¼ša£¬eƒ½eR¿e—Ra|a£¬€a¡ãc”¦Ìe„‘a£¬Šc”¡§ IIS a…¡Àao«cš„a–‡a»¶a€‚
  10. aˆ‘cš„ PHP e„šaœ¬aœ¡§ IE a’Œ Lynx a£¬‹eƒ½a¡¤£¤a½œi¼Œa½†a˜¡¥aœ¡§ Netscape a£¬-aœ‰cš„e¾“a‡oa£¬¡éa¡è¡Àao†a€‚a½“aˆ‘c”¡§a€œaŸ£¤cœ‹aoa–‡a»¶a€a—¶a¡¥a»£¤aœ¡§ IE a£¬-cœ‹aˆ¡ãa†…aR1i¼Œa½†a˜¡¥ Netscape a£¬-a£¬eƒ½a€‚
  11. aˆ‘a€Ža ¡¤a¡¤¡¤aˆa½¿c”¡§ XML a’Œ PHPi¼ŸaRƒa£¬eR¡èaˆ‘cš„ <?xml a ‡eR¡ãi¼
  12. a€Ža ¡¤c”¡§ FrontPage aˆ–e€…a…¶aRƒeže|aŠŠaˆ‘cš„a»¡êc c¡ì»a£¤c¡ì»aŽ»cš„ HTML c¼–e¾‘a™¡§a£¤c¼–e¾‘ PHPi¼Ÿ
  13. a“ae‡Œa¡¥a»£¤a‰¾aˆ¡ãa‰€aœ‰a¡¥c”¡§cš„ PHP e¡é„aRša1‰a˜e‡cš„aRŒa•¡¯aˆ—e!¡§i¼Ÿ
  14. a€Ža ¡¤a‰eƒ½a£¬c”¡§eža…e¡¯1cš„a•†a£¬šao“ ClibPDF a’Œ PDFLib a£¤c”Ÿaˆ PDF a–‡a!¡êi¼Ÿaˆ‘aƒ3e|a£¬aa…e¡¯1cš„a1¶a£¬”a£¬eœ€e|a†e¿žaŽ£¤aˆ«cš„ PDF ao“a€‚
  15. aˆ‘e¡¥•c€aœ¡§c”¡§aˆ¡¤e‡aaRša1‰a‡½a•¡ãa£¬-eR¿e—Ra£¬€a£¬aa ‡a‡†cš„ CGI a˜e‡i¼ˆa¾‹a|‚ $DOCUMENT_ROOT aˆ– $HTTP_REFERERi¼‰i¼Œa½†a˜¡¥a‰¾a£¬aˆ¡ãi¼Œa“ae‡Œa‡oao†e”™i¼Ÿ
  16. aœ‰ao› PHPa€€e€‰e!1a¡¥a»£¤aŽ£¤a—c¼ca†™cš„a-—eŠ‚a€¼i¼Œa£¬Ža»…eƒ½aŽ£¤a— integer a-—eŠ‚a€¼c›£¬aa€‚eƒ½aœ‰a“aao›c¼ca†™a-—eŠ‚a€¼i¼Ÿa¡¥a»£¤a¡ã†a…¶c”¡§aoŽ php.ini a1‹a¡è–a—i¼Ÿ
  17. ÎÒÏëдһ¸ö¿ÉÒÔ´¦ÀíÈÎºÎ±íµ¥À´µÄÊý¾ÝµÄͨÓà PHP ½Å±¾¡£ÎÒÔõô֪µÀÄĸö POST ·½·¨±äÁ¿¿ÉÓÃÄØ£¿

    PHP ÌṩºÜ¶à¡°Ô¤¶¨Òå±äÁ¿¡±£¬ÀýÈ糬ȫ¾Ö±äÁ¿ $_POST¡£¿ÉÒÔ±éÀú $_POST ±äÁ¿£¬ÒòΪËüÊÇÒ»¸öºÍËùÓÐͨ¹ý POST ·½·¨´«µÝÊý¾ÝÏàÁªÏµµÄÊý×é¡£ÀýÈ磬¿ÉÒÔÓà foreach ¼òµ¥µØ±éÀúËü£¬¼ì²é empty() Öµ£¬ÒÔ¼°½«ËüÃÇÊä³ö¡£

    <?php
    $empty 
    $post = array();
    foreach (
    $_POST as $varname => $varvalue) {
        if (empty(
    $varvalue)) {
            
    $empty[$varname] = $varvalue;
        } else {
            
    $post[$varname] = $varvalue;
        }
    }

    print 
    "<pre>";
    if (empty(
    $empty)) {
        print 
    "None of the POSTed values are empty, posted:\n";
        
    var_dump($post);
    } else {
        print 
    "We have " count($empty) . " empty values\n";
        print 
    "Posted:\n"var_dump($post);
        print 
    "Empty:\n";  var_dump($empty);
        exit;
    }
    ?>

    Note: Superglobals ¿ÉÓÃÐÔ˵Ã÷ ×Ô PHP 4.1.0 Æ𣬿ÉÒÔʹÓó¬È«¾ÖÊý×é±äÁ¿ÀýÈç $_GET£¬$_POST ºÍ $_SERVER µÈµÈ¡£¸ü¶àÐÅÏ¢ÇëÔĶÁÊÖ²áÖÐµÄ superglobals¡£

    ÎÒÐèÒªÔÚËùÓеĵ¥ÒýºÅ£¨'£©Ç°¼ÓÒ»¸ö·´Ð±Ïߣ¨\£©£¬Ê¹ËüÃDZä³É£¨\'£©£¬ÎÒÈçºÎÄܹ»Í¨¹ýÕýÔò±í´ïʽÀ´ÊµÏÖ£¿ÎÒͬÑùÏ£ÍûÄܹ»½«£¨"£©×ª»»³É£¨\"£©£¬½«£¨\£©×ª»»³É£¨\\£©¡£

    º¯Êý addslashes() Äܹ»ÊµÏÖÕâÖÖ²Ù×÷¡£Çë²ÎÔĺ¯Êý mysql_escape_string()¡£ÁíÍ⣬»¹¿ÉÒÔÓú¯Êý stripslashes() À´È¥µô·´Ð±Ïß¡£

    Note: magic_quotes_gpc ÉèÖÃÑ¡Ïî˵Ã÷ PHP µÄÉèÖÃÑ¡Ïî magic_quotes_gpc µÄĬÈÏֵΪ on¡£ÕâÏ൱ÓÚ×Ô¶¯¶ÔËùÓÐµÄ GET¡¢POST¡¢COOKIE Êý¾ÝʹÓÃÁË addslashes() º¯Êý¡£¿ÉÒÔÓà stripslashes() º¯ÊýÀ´È¥µôËüÃÇ¡£

    ÎÒËùÓеģ¨"£©ºÍ£¨'£©¶¼±»±ä³ÉÁË£¨\"£©ºÍ£¨\'£©£¬ÎÒÈçºÎ²ÅÄÜÈ¥µôÕâЩ²»±ØÒªµÄ·´Ð±Ïߣ¿ËüÃÇΪʲô¼°ÈçºÎ³öÏÖ£¿

    PHP º¯Êý stripslashes() Äܹ»´Ó string ÖÐÈ¥µôËùÓеķ´Ð±Ïß¡£ÕâЩ·´Ð±Ïß³öÏÖ×îÓпÉÄܵÄÔ­ÒòÊÇ PHP ÉèÖÃÏî magic_quotes_gpc ±»¿ªÆô¡£

    Note: magic_quotes_gpc ÉèÖÃÑ¡Ïî˵Ã÷ PHP µÄÉèÖÃÑ¡Ïî magic_quotes_gpc µÄĬÈÏֵΪ on¡£ÕâÏ൱ÓÚ×Ô¶¯¶ÔËùÓÐµÄ GET¡¢POST¡¢COOKIE Êý¾ÝʹÓÃÁË addslashes() º¯Êý¡£¿ÉÒÔÓà stripslashes() º¯ÊýÀ´È¥µôËüÃÇ¡£

    µ±ÎÒÕâÑù×öʱ£¬Êä³öÏÔʾµÄ´ÎÐòÊÇ´íµÄ£º

    <?php
    function myfunc($argument)
    {
        echo 
    $argument 10;
    }
    $variable 10;
    echo 
    "myfunc($variable) = " myfunc($variable);
    ?>
    ÕâÊÇÔõô»ØÊ£¿

    ÒªÔÚÒ»¸ö±í´ïʽÖУ¨ÀýÈçÔÚÉÏÃæµÄÀý×ÓÖкÍÆäËü×Ö·û´®Á¬½Ó£©Ê¹Óú¯ÊýµÄ½á¹û£¬ÐèÒª return() Õâ¸öÖµ£¬¶ø²»ÊÇ echo() Ëü¡£

    ÏÂÃæ´úÂëÔõôûÓзֳÉÁ½ÐÐÏÔʾ£¿

    <pre>
    <?php echo "This should be the first line."?>
    <?php 
    echo "This should show up after the new line above."?>
    </pre>

    ÔÚ PHP ÖУ¬Ò»¶Î´úÂëµÄ½áÊø±ê¼ÇҪôÊÇ¡°?>¡±ÒªÃ´ÊÇ¡°?>\n¡±£¨\n ±íʾ»»ÐУ©¡£Òò´ËÔÚÉÏÃæµÄÀý×ÓÖУ¬Êä³öµÄ¾ä×Ó½«ÏÔʾÔÚͬһÐÐÖУ¬ÒòΪ PHP ºöÂÔÁË´úÂë½áÊø±ê¼ÇºóÃæµÄ»»ÐС£ÕâÒâζ×ÅÈç¹ûÒªÊä³öÒ»¸ö»»Ðзû£¬ÐèÒªÔÚÿ¶Î PHP ´úÂëµÄ½áÊø±ê¼ÇºóÃæ¶à¼ÓÒ»¸ö»»ÐС£

    PHP ΪʲôÕâô×öÄØ£¿ÒòΪÔÚ¸ñʽ»¯Õý³£µÄ HTML ʱ£¬ÕâÑùͨ³£»á¸üÈÝÒס£¼ÙÈçÊä³öÁË»»ÐжøÄã²»ÐèÒªÕâ¸ö»»ÐÐʱ£¬¾Í²»µÃ²»ÓÃÒ»¸ö·Ç³£³¤µÄÐÐÀ´´ïµ½ÕâÑùµÄЧ¹û£¬»òÕßÈòúÉúµÄ HTML Ò³ÃæµÄÔ´ÎļþµÄ¸ñʽºÜÄѶÁ¡£

    Îҵõ½ÏûÏ¢¡°Warning: Cannot send session cookie - headers already sent...¡±»òÕß¡°Cannot add header information - headers already sent...¡±¡£

    º¯Êý header()£¬setcookie() ºÍ session º¯ÊýÐèÒªÔÚÊä³öÁ÷ÖÐÌí¼ÓÍ·ÐÅÏ¢¡£µ«ÊÇÍ·ÐÅÏ¢Ö»ÄÜÔÚÆäËüÈκÎÊä³öÄÚÈÝ֮ǰ·¢ËÍ¡£ÔÚʹÓÃÕâЩº¯ÊýÇ°²»ÄÜÓÐÈκΣ¨Èç HTML£©µÄÊä³ö¡£º¯Êý headers_sent() Äܹ»¼ì²é½Å±¾ÊÇ·ñÒѾ­·¢ËÍÁËÍ·ÐÅÏ¢¡£Çë²ÎÔÄÊä³ö¿ØÖƺ¯Êý¡£

    ÎÒÐèÒªÖ±½Ó·ÃÎÊÇëÇó±¨Í·ÖеÄÐÅÏ¢£¬ÔõôÄÜ°ìµ½£¿

    Èç¹ûÒÔ Apache µÄÄ£¿é·½Ê½ÔËÐÐ PHP£¬ÄÇôº¯Êý getallheaders() ¿ÉÒÔ×öÕâ¼þÊ¡£Òò´ËÏÂÃæµÄ´úÂë¿ÉÒÔÏÔʾËùÓеÄÇëÇó±¨Í·£º

    <?php
    $headers 
    getallheaders();
    foreach (
    $headers as $name => $content) {
        echo 
    "headers[$name] = $content<br />\n";
    }
    ?>

    Çë²ÎÔĺ¯Êý apache_lookup_uri()¡¢apache_response_headers() ºÍ fsockopen()¡£

    µ±ÎÒÓà IIS ½øÐÐ HTTP ÈÏ֤ʱµÃµ½¡°No Input file specified¡±ÏûÏ¢¡£

    IIS µÄ°²È«Ä£ÐÍÕâÀïÓÐ벡¡£ÕâÊÇËùÓÐ IIS ÏÂÔËÐÐµÄ CGI ³ÌÐòËù¹²ÓеÄÎÊÌâ¡£Ò»¸ö½â¾ö°ì·¨Êǽ¨Á¢Ò»¸ö´¿ HTML Îļþ£¨²»¾­¹ý PHP ½âÎö£©×÷ΪҪ½øÈëÈÏ֤Ŀ¼µÄµÇ¼ҳÃ棬ȻºóÓà META ±ê¼ÇÀ´Öض¨Ïòµ½ PHP Ò³Ã棬»òÕßÓÃÒ»¸öÁ¬½Óµ½ PHP Ò³Ã档Ȼºó PHP ¾Í¿ÉÒÔÕýȷʶ±ðÈÏÖ¤ÐÅÏ¢ÁË¡£Èç¹ûÊÇÓà ISAPI Ä£¿é£¬ÄÇûÓÐÕâ¸öÎÊÌâ¡£ÆäËü NT Ï嵀 web ·þÎñÆ÷²»ÊÜ´ËÓ°Ïì¡£¸ü¶àÐÅÏ¢¼û » http://support.microsoft.com/kb/q160422/¼° HTTP ÈÏÖ¤Ò»Õ¡£

    Windows£º²»ÄÜ·ÃÎÊÁíһ̨µçÄÔÉÏÓà IIS ¹²ÏíµÄÎļþ¡£

    ±ØÐëÒª×öЩÐ޸ġ£´ò¿ª Internet ÐÅÏ¢·þÎñ£¬ÕÒµ½ÄãµÄ PHP Îļþ²¢´ò¿ªÊôÐÔÒ³£¬Ñ¡ÔñÎļþ°²È«ÐÔ±êÇ©£¬µã»÷ÄäÃû·ÃÎʺÍÉí·ÝÑéÖ¤¿ØÖƵġ°±à¼­¡±°´Å¥¡£

    ½â¾ö´ËÎÊÌâÓÐÁ½¸ö·½·¨£¬Ò»ÊDz»ÒªÑ¡ÖÐÄäÃû·ÃÎʲ¢ÇÒÑ¡Öм¯³É Windows Éí·ÝÑéÖ¤£¬¶þÊÇÑ¡ÖÐÄäÃû·ÃÎʲ¢±à¼­ÄäÃû·ÃÎÊʹÓõÄÕÊ»§£¬¸Ä³ÉÒ»¸öÓÐȨÏ޵ġ£

    ÎÒµÄ PHP ½Å±¾ÔÚ IE ºÍ Lynx ÏÂÄܹ¤×÷£¬µ«ÊÇÔÚ Netscape ÖÐÓеÄÊä³ö¶ªÊ§ÁË¡£µ±ÎÒÓᰲ鿴ԴÎļþ¡±Ê±¿ÉÒÔÔÚ IE Öп´µ½ÄÚÈÝ£¬µ«ÊÇ Netscape Öв»ÄÜ¡£

    Netscape ÔÚ¹ØÓÚ HTML ±ê¼Ç£¨ÀýÈç table£©ÉÏ±È IE ¸üÑϸñ¡£ÓÃÒ»¸ö HTML ÑéÖ¤Æ÷£¬ÀýÈç » validator.w3.org À´ÑéÖ¤ÄãµÄ HTML Êä³ö¿ÉÄÜ»áÓаïÖú¡£ÀýÈç©ÁË </table> ¿ÉÄܻᵼÖÂÕâÑùµÄ½á¹û¡£

    ͬÑù£¬IE ºÍ Lynx ¶¼ºöÂÔÁË HTML Á÷ÖеÄÈκΠNULs£¨\0£©£¬Netscape ¾Í²»¡£×îºÃµÄ¼ì²é·½·¨ÊDZàÒë PHP µÄÃüÁîÐÐģʽ°æ±¾£¨Ò²³ÆΪ CGI °æ±¾£©²¢´ÓÃüÁîÐÐÔËÐÐÄãµÄ½Å±¾¡£ÔÚ *nix ÖУ¬ÓùܵÀ´«µÝµ½ od -c ²¢²é¿´ÈκΠ\0 ×Ö·û¡£Èç¹ûÔÚ Windows ÏÂÄãÐèÒªÄܹ»²é¿´¶þ½øÖÆÎļþ¸ñʽµÄ±à¼­Æ÷»ò³ÌÐò¡£µ± Netscape Åöµ½ NUL ʱ¾Í²»»áÊä³öÖ®ºó¸ÃÐеÄÈκÎÄÚÈݶø IE ºÍ Lynx ¶¼»á¡£

    ÎÒÔõÑù»ìºÏʹÓà XML ºÍ PHP£¿Ëü²»ÈÏÎÒµÄ <?xml ±ê¼Ç£¡

    ÒªÄܹ»ÔÚ PHP ´úÂëÖÐÖ±½ÓǶÈë <?xml£¬ÐèÒª½« PHP ÉèÖÃÏî short_open_tags ÉèÖÃΪ 0 ÒԹرն̱ê¼Ç¸ñʽ¡£ÎÞ·¨Í¨¹ýº¯Êý ini_set() À´¸ü¸ÄÕâÏîÉèÖᣲ»¹Ü short_open_tags ÊÇ¿ª»òÕ߹أ¬¶¼¿ÉÒÔÓÃÀàËÆÓÚ <?php echo '<?xml'; ?> µÄ·½·¨´ïµ½Ä¿µÄ¡£¸ÃÏîÉèÖõÄĬÈÏֵΪ¿ª¡£

    ÔõÑùÓà FrontPage »òÕßÆäËü·ÇÒª°ÑÎҵĴúÂëÒÆÀ´ÒÆÈ¥µÄ HTML ±à¼­Æ÷À´±à¼­ PHP£¿

    ×î¼òµ¥µÄ·½·¨ÊÇÈà PHP ´úÂëÒ²ÄÜʹÓà ASP ±ê¼Ç¡£Õâ¿ÉÒÔÈÃÄãÓà ASP ·ç¸ñµÄ <% ºÍ %> ´úÂ붨½ç·û¡£Ò»Ð©Á÷ÐÐµÄ HTML ±à¼­Æ÷ÔÚ´¦Àí´Ë¸ñʽÉϸü¼ÓÖÇÄÜ»¯Ò»Ð©£¨Ä¿Ç°Èç´Ë£©¡£ÒªÊ¹Óà ASP ·ç¸ñµÄ±ê¼Ç£¬ÐèÒªÔÚ php.ini Öдò¿ª asp_tags£¬»òÕßÓÃÏàÓ¦µÄ Apache ÅäÖÃÑ¡Ïî¡£

    ÄÄÀï¿ÉÒÔÕÒµ½ËùÓпÉÓÃµÄ PHP Ô¤¶¨Òå±äÁ¿µÄÍêÕûÁÐ±í£¿

    ÇëÔĶÁÊÖ²áÖеÄÔ¤¶¨Òå±äÁ¿Ò»Õ£¬¸Ã²¿·ÖµÄÎĵµÒѾ­°üº¬ÁËÒ»²¿·Ö¿ÉÒÔÓÃÓÚÄãµÄ½Å±¾µÄÔ¤¶¨Òå±äÁ¿µÄÁÐ±í¡£¿ÉÓñäÁ¿µÄÍêÕûÁÐ±í£¨¼°¸ü¶àÐÅÏ¢£©¿ÉÒÔͨ¹ýµ÷Óà phpinfo() º¯ÊýÀ´²éÔÄ¡£ÇëÎñ±ØÔĶÁÊÖ²áÖÐÀ´×Ô PHP Ö®ÍâµÄ±äÁ¿Ò»½Ú£¬Õⲿ·ÖÎĵµ²ûÊöÁËÍⲿ±äÁ¿µÄ¸ÅÄÀýÈçÀ´×Ô HTML ±íµ¥¡¢Cookie ºÍ URL µÄ±äÁ¿¡£

    Note: register_globals ÖØҪ˵Ã÷ ×Ô PHP 4.2.0 Æð£¬PHP ÖеÄÑ¡Ïî register_globals µÄĬÈÏÖµ±»ÉèΪ off£¬²¢ÇÒ×Ô PHP 6.0.0 Æð»á±»³¹µ×È¥³ý¡£PHP ÉçÇø¹ÄÀø´ó¼Ò²»ÒªÒÀÀµÓÚÕâ¸öÑ¡ÏÓÃÆäËü·½·¨Ìæ´ú£¬ÀýÈçsuperglobals¡£

    ÔõÑù²ÅÄܲ»Ó÷ÇÃâ·ÑµÄÉÌÒµ¿â ClibPDF ºÍ PDFLib À´Éú³É PDF Îĵµ£¿ÎÒÏëÒª¸öÃâ·ÑµÄ²¢ÇÒ²»ÐèÒªÔÙÁ¬½Ó±ðµÄ PDF ¿â¡£

    Óм¸¸öÑ¡Ôñ£¬ÀýÈç » http://www.ros.co.nz/pdf/£¬» http://www.fpdf.org/£¬» http://www.gnuvox.com/pdf4php/ ºÍ » http://www.potentialtech.com/ppl.php¡£»¹ÓÐÒ»¸ö » Panda Ä£¿é¡£

    ÎÒÊÔ×ÅÔÚÓû§×Ô¶¨Ò庯ÊýÖзÃÎÊÒ»¸ö±ê×¼µÄ CGI ±äÁ¿£¨ÀýÈç $DOCUMENT_ROOT »ò $HTTP_REFERER£©£¬µ«ÊÇÕÒ²»µ½£¬ÄÄÀï³öÁË´í£¿

    Ê×Ïȷdz£ÖØÒªµÄÒ»µãÊÇ PHP ÉèÖÃÏî register_globals ͬÑù»á¶Ô·þÎñÆ÷¶ËºÍ»·¾³±äÁ¿²úÉúÓ°Ïì¡£µ± register_globals = off £¨´Ó PHP 4.2.0 ¿ªÊ¼ÆäĬÈÏֵΪ off£©£¬±äÁ¿ $DOCUMENT_ROOT ½«²»»á´æÔÚ£¬¶øÖ»ÓÐ $_SERVER['DOCUMENT_ROOT']¡£Èç¹û register_globals = on Ôò±äÁ¿ $DOCUMENT_ROOT ºÍ $GLOBALS['DOCUMENT_ROOT'] ½«Í¬Ê±´æÔÚ¡£

    Èç¹ûÈ·ÈÏ register_globals = on µ«²»ÖªµÀΪʲô $DOCUMENT_ROOT ÔÚº¯ÊýÄÚ²¿²»¿ÉÓã¬ÕâÊÇÒòΪËüºÍÆäËüµÄ±äÁ¿Ò»ÑùÐèÒªÔÚº¯ÊýÖÐÖ´ÐÐ global $DOCUMENT_ROOT¡£Çë²ÎÔÄÊÖ²áÖеıäÁ¿·¶Î§Ò»½Ú¡£½¨ÒéÔÚ register_globals = off µÄÇé¿öϽøÐбàÂë¡£

    Note: Superglobals ¿ÉÓÃÐÔ˵Ã÷ ×Ô PHP 4.1.0 Æ𣬿ÉÒÔʹÓó¬È«¾ÖÊý×é±äÁ¿ÀýÈç $_GET£¬$_POST ºÍ $_SERVER µÈµÈ¡£¸ü¶àÐÅÏ¢ÇëÔĶÁÊÖ²áÖÐµÄ superglobals¡£

    ÓÐЩ PHP¡¡Ñ¡Ïî¿ÉÒÔ½ÓÊÜËõдµÄ×Ö½ÚÖµ£¬Óë½öÄܽÓÊÜ integer ×Ö½ÚÖµÏà·´¡£¶¼ÓÐÄÄЩËõд×Ö½ÚÖµ£¿¿ÉÒÔ½«ÆäÓÃÓÚ php.ini Ö®ÍâÂð£¿

    ¿ÉÓõÄÑ¡ÔñÓÐ K£¨¶ÔÓ¦ Kilobytes£©£¬M£¨¶ÔÓ¦ Megabytes£©ºÍ G£¨¶ÔÓ¦ Gigabytes£»×Ô PHP 5.1.0 Æð¿ÉÓã©£¬Çø·Ö´óСд¡£ÆäÓàµÄ¶¼ÈÏΪÊÇ×Ö½Ú¡£1M µÈÓÚÒ»¸ö Megabyte£¬¼´ 1048576 ×Ö½Ú¡£1K µÈÓÚÒ»¸ö Kilobyte£¬¼´ 1024 ×Ö½Ú¡£²»ÄÜÔÚ php.ini Ö®ÍâʹÓÃÕâЩ·ûºÅ£¬×îºÃÓÃÕûÊýµÄ integer ×Ö½ÚÖµ¡£²Î¼û ini_get() ÎĵµÖеÄת»»Ê¾Àý¡£