php£ºÐÞ¸ÄĿ¼ÏÂÎĵµÈ¨ÏÞ£¨777£¬644 £©
ÎÄÕ·ÖÀà:PHP±à³Ì
PHP chmod() º¯Êý (upload image permit)
PHP Filesystem º¯Êý
¶¨ÒåºÍÓ÷¨
chmod() º¯Êý¸Ä±äÎļþģʽ¡£
Èç¹û³É¹¦Ôò·µ»Ø TRUE£¬·ñÔò·µ»Ø FALSE¡£
Óï·¨
chmod(file,mode)
²ÎÊý
ÃèÊö
file
±ØÐè¡£¹æ¶¨Òª¼ì²éµÄÎļþ¡£
mode
¿ÉÑ¡¡£¹æ¶¨ÐµÄȨÏÞ¡£
mode ²ÎÊýÓÉ 4 ¸öÊý×Ö×é³É£º
µÚÒ»¸öÊý×ÖÓÀÔ¶ÊÇ 0
µÚ¶þ¸öÊý×ֹ涨ËùÓÐÕßµÄȨÏÞ
µÚ¶þ¸öÊý×ֹ涨ËùÓÐÕßËùÊôµÄÓû§×éµÄȨÏÞ
µÚËĸöÊý×ֹ涨ÆäËûËùÓÐÈ˵ÄȨÏÞ
¿ÉÄܵÄÖµ£¨ÈçÐèÉèÖöà¸öȨÏÞ£¬Çë¶ÔÏÂÃæµÄÊý×Ö½øÐÐ×ܼƣ©£º
1 - Ö´ÐÐȨÏÞ
2 - дȨÏÞ
4 - ¶ÁȨÏÞ
Àý×Ó
Java´úÂë
<?php
// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈËûÓÐÈκÎȨÏÞchmod("test.txt",0600);// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈ˿ɶÁ
chmod("test.txt",0644);// ËùÓÐÕßÓÐËùÓÐȨÏÞ£¬ÆäËûËùÓÐÈ˿ɶÁºÍÖ´ÐÐchmod("test.txt",0755);// ËùÓÐÕßÓÐËùÓÐȨÏÞ£¬ËùÓÐÕßËùÔÚµÄ×é¿É¶Áchmod("test.txt",0740);
?>
<?php
// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈËûÓÐÈκÎȨÏÞchmod("test.txt",0600);// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈ˿ɶÁ
chmod("test.txt",0644);// ËùÓÐÕßÓÐËùÓÐȨÏÞ£¬ÆäËûËùÓÐÈ˿ɶÁºÍÖ´ÐÐchmod("test.txt",0755);// ËùÓÐÕßÓÐËùÓÐȨÏÞ£¬ËùÓÐÕßËùÔÚµÄ×é¿É¶Áchmod("test.txt",0740);
?>
PHP ʹÓà chmod() µÄ×¢ÒâÊÂ項
ÓÉì¶Ä³虛擬Ö÷機ÉÏÓöµ½ºÜÆæÃîµÄ狀況, ×ö圖ƬÉÏ傳µÄ¹¦ÄÜ, µ«ÊÇ圖ƬÉÏ傳áá, 權ÏÞÊÇ 600, ¶ø owner ÊÇ Apache user, ËùÒÔÒª×ö local µÄ備·Ý時, ÄÇЩÉÏ傳µÄ圖Ƭ¶¼無·¨備·Ý.
´Ë狀況Ö»ºÃ寫個³Ìʽ讓 Apache user 來×ö chmod µÄ動×÷, 將圖Ƭ檔°¸權ÏÞ¶¼¸Ä³É 644 ²ÅÐÐ.
ÐÞ¸ÄÄ¿錄ÏÂËùÓÐ檔°¸權ÏÞ
Òª將Ä¿錄ϵÄ檔°¸¶¼ÐÞ¸Ä³É 644, ÐÞ¸ÄÈ«²¿權Ï޵ķ½·¨ºÜ簡單, ³ÌʽÈçÏÂ: (¼Ù設檔ÃûÊÇ chmod.php)
Php´úÂë
<?php
`chmod 644 *`;
?>
<?php
`chmod 644 *`;
?>
ì¶網Ö·連結 http://DOMAIN-NAME/chmod.php ¾Í會將
Ïà¹ØÎĵµ£º
¡¡¡¡¶ÔÓÚ³õѧPHPÓïÑÔµÄÅóÓÑÀ´Ëµ£¬PHP»¹ÓкܶණÎ÷ÐèÒªÉîÈëµÄ̽¾¿¡£Ö»ÓÐÔÚ²»¶ÏµÄÎÊÌâ´¦ÀíÖвÅÄÜÕÆÎÕÆäÖеÄÕæÖ¿¡£Ê²Ã´ÊÇPHPÎÞÏÞ·ÖÀàÄØ?¾ÍÏñwindowsÏÂн¨Ò»¸öÎļþ¼Ð£¬ÔÚн¨µÄÎļþ¼ÐÏÂÓÖ¿ÉÒÔн¨Ò»¸öÎļþ¼Ð£¬ÕâÑùÎÞÏÞÑ»·ÏÂÈ¥£¬ÎÞÏÞ·ÖÀàÒ²ÊÇÕâÑù£¬¸¸Àà¿ÉÒÔ·Ö³öËü×ÓÀ࣬×ÓÀàÓÖ¿ÉÒÔ·Ö³öËüµÄ×ÓÀ࣬ÕâÑùÒ»Ö±ÎÞÏÞÑ»·ÏÂÈ¥¡£
¡¡¡¡Ä ......
$thunder = ("Thunder://QUFodHRwOi8vNjAuMTkxLjYwLjEwODo4MDgwL3hweGlhemFpL0RlZXBpbl9HaG9zdF9YUF9WMTguMC5pc29aWg==");
//½âÃÜËü
$thunder = trim($thunder,'Thunder://');
$c_thunder = base64_decode($thunder);
$c_thunder = ltrim(rtrim($c_thunder,'ZZ'),'AA');
//out [url]http://60.191.60.108:8080/xpxi ......
ÉùÃ÷£º²¿ÊðDedeCMS£¬ÔÚÍøÉÏËÑÁ˺ܶà×ÊÁÏ£¬°üÀ¨Õâ¸öÂÛ̳£¬¼¸ºõûÓз¢ÏÖÔÚlinuxϲ¿ÊðµÄÏÖ³É×ÊÁÏ¿ÉÒԲο¼¡£
Ë죬×Ô¼º°ÑÕû¸ö²¿Êð¹ý³ÌÖÐһЩÖØÒªµÄµã¼Ç¼ÏÂÀ´£¬Ò»ÊÇËã×ö×Ô¼ºµÄÀͶ¯³É¹û£¬Í¬Ê±£¬ÆÚÍû¶ÔÔø¾ºÍÎÒÒ»ÑùÃÔ㣬²»ÖªÈçºÎ²¿Êð   ......
phpÖеÄevalºÍJavaScriptÖеÄevalÇø±ð£º
Definition and Usage
¶¨ÒåºÍÓ÷¨
The eval() function evaluates a
string as PHP code.
eval()º¯ÊýµÄ×÷ÓÃÊÇ£º·µ»ØÓëPHP´úÂëÏà¶ÔÓ¦µÄ×Ö·û´®¡£
The string
must be valid PHP code and must end with semicolon.
Õâ¸ö×Ö·û´®±ØÐëÊÇÓÐЧµÄPHP´úÂ룬
²¢ÇÒ±ØÐëÒԷֺŽáÊø¡ ......
±±¾©´óѧÈí¼þÓë΢µç×ÓѧԺ“¶à²ã´Î¡¢¶à·½Ïò¡¢¶àÁìÓò¡¢Ä£¿é»¯” µÄ¿ª·Åʽ¿Î³ÌÌåϵ£¬¾Êµ¼ù¼ìÑéÖ¤Ã÷£¬·Ç³£ÊÊÓÃÓÚÅàÑø“¶à²ã´Î¡¢ÊµÓÃÐÍ¡¢¸´ºÏ½»²æÐÍ¡¢¹ú¼Ê»¯”µÄÈí¼þÓë΢µç×ÓÈ˲š£ÎªÂú×ãÉç»áºÍÆóÒµ¶ÔÈ˲ŵÄÐèÇ󣬶ԸßÖÊÁ¿µÄ¼ÌÐø½ÌÓýÏîÄ¿µÄÐèÇ󣬱±¾©´óѧÈí¼þÓë΢µç×ÓѧԺ³ÉÁ¢Á˼ÌÐø½ÌÓýÖÐÐÄ£¬ÃæÏòÉ ......