phpÏÂÔØÎļþ´úÂë
Ò»°ãµÄÎļþ°²È«ÏÂÔØ·½·¨¿ÉÒÔʹÓÃÏÂÃæµÄ´úÂë:
1. <?php?
2.
3. $durl = 'file/phpcms2008_o2abf32efj883c91a.iso';
4. $filename = 'phpcms2008_o2abf32efj883c91a.iso';
5. $file = @fopen($durl, 'r');
6. header("Content-Type: application/octet-stream");
7. header("Accept-Ranges: bytes");
8. header("Accept-Length: ".filesize($durl));
9. header("Content-Disposition: attachment; filename=".$filename);
10. echo fread($file,filesize($durl));
11. fclose($file);
12. ?>
µ«ÊÇÎļþÒ»´ó£¨³¬¹ýphp.iniÅäÖõÄÄÚ´æ×î´óÖµ£©£¬ÕâÀï¾Í³öÎÊÌâÁË£¬·þÎñÆ÷»á·Ç³£Õ¼ÓÃCPU×ÊÔ´£¬¸üÖØÒªµÄÊÇÎļþ²»ÄÜÕý³£ÏÂÔØ£¬Ö»ÄÜÏÂÔØ¼¸Ê®KbµÄÎļþ£¬Ã÷ÏÔ²»ÊÇÔ¤ÆÚÏëÒªµÄ¡£
1. function download($url, $filename) {
2.
3. // »ñµÃÎļþ´óС, ·ÀÖ¹³¬¹ý2GµÄÎļþ, ÓÃsprintfÀ´¶Á
4. $filesize = sprintf ( "%u", filesize ( $url ) );
5. if (! $filesize) {
6. return;
7. }
8. header ( "Content-type:application/octet-stream\n" ); //application/octet-stream
9. header ( "Content-type:unknown/unknown;" );
10. header ( "Content-disposition: attachment; filename=\"" . $filename . "\"" );
11. header ( 'Content-transfer-encoding: binary' );
12. if ($range = getenv ( 'HTTP_RANGE' )) { // µ±ÓÐÆ«ÒÆÁ¿µÄʱºò£¬²ÉÓÃ206µÄ¶ÏµãÐø´«Í·
13. $range = explode ( '=', $range );
14. $range = $range [1];
15.
16. header ( "HTTP/1.1 206 Partial Content" );
17. header ( "Date: " . gmdate ( "D, d M Y H:i:s" ) . " GMT" );
18. header ( "Last-Modified: " . gmdate ( "D, d M Y H:i:s", filemtime ( $url ) ) . " GMT" );
19. header ( "Accept-Ranges: bytes" );
20. header ( "C
Ïà¹ØÎĵµ£º
<?php
if (!get_magic_quotes_gpc()) {
add_slashes($_GET);
add_slashes($_POST);
add_slashes($_COOKIE);
}
function add_slashes($string) {
if (is_array($string)) {
foreach ($string as $key => $value) {
$string ......
×î½üÈ¥ÃæÊÔPHP³ÌÐòÔ± ³öÁËÒ»µÀÕâÑùµÄÌâ “php±éÀúÕû¸öĿ¼µÄÎļþÒÔ¼°Îļþ¼Ð ·â×°³Éº¯Êý”˳±ãÒ²¾ÍÌùÁËÉÏÀ´¡£ÐèÒªµÄÅóÓÑ¿ÉÒÔÄÃÈ¥ÓÃÓ㬽ö¹©Ñ§Ï°½»Á÷ʹÓá£ÈçÓв»Ç¡µ±µÄµØ·½»¹Çë¸÷λ¸ßÊÖ“×ìÏÂÁôÈË” °¡£¡
<?php
$path=$_SERVER["DOCUMENT_ROOT"];
$path=str_replace("/","\\",$path);
$path="$ ......
Ê×ÏÈPerl mkdir µÄÓï·¨ÊÇ£º
1.mkdir('dir', ´ú±í¾Åλ¶þ½øÖÆÊý×ÖµÄÊ®½øÖÆÖµ)
ÉèÖÃ775£¬Ôò¸ÃֵΪʮ½øÖƵÄ509£¬¼´¶þ½øÖƵÄ111111101
´ËÊýÖµ²»ÄÜÉèÖÃΪ111111111¼´Ê®½øÖƵÄ511¼´777¡£
2.mkdir('dir', 0³£¼ûunix3λȨÏÞ)
¿ÉÒÔÉèÖÃ777¡£
È»ºóÔÚlinuxÏÂʱ£¬ÓÉÓÚumaskµÄÔÒò£¬Ö»ÄÜÉèÖÃΪ755¡£
ÒòΪ´´½¨ÎļþʱµÄȨÏÞÊÇumaskºÍ ......
¸Ðл×÷Õߣ¬ÎÄÕÂÀ´Ô´
http://www.csask.com/blog/?p=108
eclipseÊÇÎҷdz£Ï²»¶µÄIDE£¬¿ªÔ´+Ãâ·Ñ+¹¦ÄÜÇ¿´ó+¿çƽ̨+¿çÓïÑÔ+²å¼þ»úÖÆ£¬ËäÈ»ÓÐʱºòÒ²»áÓÐÕâÑùÄÇÑùµÄÎÊÌ⣬µ«ÊÇ×÷ΪÖ÷Á¦¿ª·¢IDE£¬eclipseÒѾ·Ç³£×ã¹»ÁË¡£
µÚ1²½£¬°²×°JRE£º
sudo apt-get install sun-java6-jre
µÚ2²½£¬ÏÂÔØeclipse£º
http://www.eclipse.or ......
http://www.phpip.com/program/php/A62010901P/25588.html
ÕâÆªÎÄÕµijö·¢µãÊÇÎÒ¶Ô²å¼þ»úÖÆµÄÀí½â£¬¼°ÆäÔÚPHPÖеÄʵÏÖ¡£´Ë·½°¸½öÊDzå¼þ»úÖÆÔÚPHPÖеÄʵÏÖ·½°¸Ö®Ò»£¬Ð´ÏÂÀ´ºÍ´ó¼Ò·ÖÏí£¬»¶Ó´ó¼ÒÒ»ÆðÌÖÂÛ¡£
²å¼þ£¬Ò༴Plug-in£¬ÊÇÖ¸Ò»ÀàÌØ¶¨µÄ¹¦ÄÜÄ£¿é£¨Í¨³£ÓɵÚÈý·½¿ª·¢ÕßʵÏÖ£©£¬ËüµÄÌØµãÊÇ£ºµ±ÄãÐèÒªËüµÄʱºò¼¤»îËü£¬²»Ð ......