Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

phpÏÂÔØÎļþÏà¹Ø×ÊÁÏ

µ±ÏÂÔØÎļþÐèÒªÓë·þÎñ¶Ë½»»¥Ê±£¬¾ÍÐèÒªÓýű¾À´ÊµÏÖ£¬¶ø²»Êǵ¥´¿µØÁ´½Óµ½ÎļþµÄµØÖ·
ÏÂÔØmp3ÎļþµÄÀý×Ó
<?php
$file_path = './data/upload/song/sample.mp3';
$file_name = 'sample.mp3';
$file_size = filesize($file_path);
header ( "Pragma: public" );
header ( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
header ( "Cache-Control: private", false );
header ( "Content-Transfer-Encoding: binary" );
header ( "Content-Type:audio/mpeg MP3");
header ( "Content-Length: " . $file_size);
header ( "Content-Disposition: attachment; filename=".$file_name);
echo(file_get_contents($file_path));
exit;
?>
ÒÔÏÂÁбíÀ´×Ôhttp://hi.baidu.com/zbzb /blog/item/643cd60021d25d11738b6530.html
Content-type µÄ˵Ã÷ 'application/andrew-inset',
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'doc' => 'application/msword',
'bin' => 'application/octet-stream',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => 'application/octet-stream',
'class' => 'application/octet-stream',
'so' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => 'application/pdf',
'ai' => 'application/postscript',
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',
'wbxml' => 'application/vnd.wap.wbxml',
'wmlc' => 'application/vnd.wap.wmlc',
'wmlsc' => 'application/vnd.wap.wmlscriptc',
'bcpio' => 'application/x-bcpio',
'vcd' => 'application/x-cdlink',
'pgn' => 'application/x-chess-pgn',
'cpio' => 'application/x-cpio',
'csh' => 'application/x-csh',
'dcr' => 'application/x-director',
'di


Ïà¹ØÎĵµ£º

PHPÎļþº¯Êý´óÈ«

ת×Ô http://wiki.kuaizhanbao.com/2009/1210/245.html
basename — ·µ»Ø·¾¶ÖеÄÎļþÃû²¿·Ö
chgrp — ¸Ä±äÎļþËùÊôµÄ×é
chmod — ¸Ä±äÎļþģʽ
chown — ¸Ä±äÎļþµÄËùÓÐÕß
clearstatcache — Çå³ýÎļþ״̬»º´æ
copy — ¿½±´Îļþ
delete — ²Î¼û unlink() »ò unset()
di ......

ÖØȼÄãµÄPHP°²È«Ö®»ð

¶ÔÓڽű¾°²È«Õâ¸ö»°ÌâºÃÏñÓÀԶûÍêûÁË£¬Èç¹ûÄã¾­³£µ½¹úÍâµÄ¸÷ÖÖ¸÷ÑùµÄbugtraqÉÏ£¬Äã»á·¢ÏÖÓÐÒ»°ëÒÔÉ϶¼ºÍ½Å±¾Ïà¹Ø£¬ÖîÈçSQL
injection£¬XSS£¬Path Disclosure£¬Remote commands
executionÕâÑùµÄ×ÖÑ۱ȱȽÔÊÇ£¬ÎÒÃÇ¿´ÁËÖ®ºóµÄÓÃ;ÄѵÀ½ö½öÊÇ×¥È⼦?¶ÔÓÚÎÒÃÇÏë×öweb°²È«µÄÈËÀ´Ëµ£¬×îºÃ¾ÍÊÇÄÃÀ´Ñ§Ï°£¬¿ÉÊÇÍòÎï×¥¸ùÔ´£¬ÎÒà ......

ÌÚѶphp¿ª·¢¹¤³ÌʦÃæÊÔÌâ

1
£®
Çë¶Ô
POSIX
·ç¸ñºÍ¼æÈÝ
Perl
·ç¸ñÁ½ÖÖÕýÔò
±í´ïʽµÄÖ÷Òªº¯Êý½øÐÐÀà±È˵Ã÷
ereg
preg_match
ereg_replace
preg_replace






2
£®
Çë˵Ã÷ÔÚ
php
.ini
ÖÐ
safe_mode
¿ªÆôÖ®ºó¶ÔÓÚ
PHP
ϵͳ
º¯ÊýµÄÓ°Ïì








3
£®
PHP5
ÖÐħÊõ
·½·¨
º¯ÊýÓÐÄļ¸¸ö£¬Çë¾ÙÀý˵à ......

phpÎļþÉÏ´«Àà

 
<?php
  /**
  * PHP100.com - ¸öÈ˸оõ·Ç³£¼òµ¥£¬Ö»ÒªÓеãPHP»ù´¡µÎÈ˶¼Ó¦¸ÃÄÜ¿´¶®~~
  * Apache2 + PHP5.0
  * Version:1.0
  * ͬʱ¸ÐлPHP100ËùÓеÄÐÖµÜÃÇ
  * ——————————————&m ......

php sessionÅäÖÃ

Session]
; ³ý·ÇʹÓÃsession_register()»ò$_SESSION×¢²áÁËÒ»¸ö±äÁ¿¡£
; ·ñÔò²»¹ÜÊÇ·ñʹÓÃÁËsession_start()£¬¶¼²»»á×Ô¶¯Ìí¼ÓÈκÎsession¼Ç¼¡£
; °üÀ¨resource±äÁ¿»òÓÐÑ­»·ÒýÓõĶÔÏó°üº¬Ö¸Ïò×ÔÉíµÄÒýÓõĶÔÏ󣬲»Äܱ£´æÔڻỰÖС£
; register_globalsÖ¸Áî»áÓ°Ïìµ½»á»°±äÁ¿µÄ´æ´¢ºÍ»Ö¸´¡£
session ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ