บล็อก ของ ลิงดำ ผู้นั่งหน้าคอมทั้งวัน


change file attributes by php
พฤษภาคม 12, 2008, 7:38 pm
Filed under: คอมพิวเตอร์computer

คนทำเว็บคงจะรู้กันดีว่ามันคืออะไร โดยปกติแล้วเราต้องไปเปลี่ยนใน ftp ซึ่งลำบาก พอสมควรวันนี้เลยเอา code มาแบ่งกันครับ

<?php
chmod
("/somedir/somefile", 755); // อันนี้ผิดนะครับ
chmod("/somedir/somefile", "u+rwx,go+rx"); // เป็น string ไม่ได้นะครับ
chmod("/somedir/somefile", 0755); // อันนี้ถูกต้องเลย

ตรง /somedir/somefile ก็เปลี่ยนเป็นชื่อไฟล์นะครับ


No Comments Yet ห่างไกล
ใส่ความเห็น



ใส่ความเห็น
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>