Go Back   Novahq.net Forum > Computers > Web design and Programming

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-19-2005, 11:05 AM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

PHP experts, please help!

Hey, pretty basic question

is there a way with php, that when i run the script, it will make everything 0777 in a certain folder? Please Help
Reply With Quote
  #2  
Old 03-19-2005, 11:12 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
I know there is a way because I have seen some file managers do it. Not sure how though.
__________________
Reply With Quote
  #3  
Old 03-19-2005, 11:53 AM
Stu is offline Stu
Resident Member

Join Date: Aug 2003
Posts: 3,319

as in CHMOD it automatically? Same here, I know there is a way, but havent a clue what it is
Reply With Quote
  #4  
Old 03-19-2005, 12:56 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

i can chmod stuff when it's uploaded, i want to run a script tho, that will change all the chmod of every file in a certain folder...perhaps this is possible?
Reply With Quote
  #5  
Old 03-19-2005, 12:59 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
It is!!

Check out php.resourceindex.com and see if they have a function that lets you do it.
__________________
Reply With Quote
  #6  
Old 03-19-2005, 02:10 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
This is untested, but it is a start:

Code:
function chmodFiles($path){
if ($handle = opendir("$path")) {
   echo "current directory handle: $handle\n";
      
   while (false !== ($file = readdir($handle))) {
       echo "Chmod: $file\n";
       chmod("$file", 0755);
   }

   closedir($handle);
}
}
You may have to replace the chmod line above with

Code:
chmod("$path/$file", 0755);
.

Basically what it does is loops through all the files in the specified directory. I just don't know if the variable $files contains the full path, or just the file name.

Hope this helps.

IcI

Ps... I got this from php.net, php.net has always been able to provide me an answer ;-)
Reply With Quote
  #7  
Old 03-19-2005, 02:50 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

http://server4.heavydatahosting.com/...ksquad/777.php

i get an error, read please, i need to do this, i have lots of direcetories, i need to make 777 lol...so much!
Reply With Quote
  #8  
Old 03-19-2005, 03:33 PM
Stu is offline Stu
Resident Member

Join Date: Aug 2003
Posts: 3,319

argh .
Reply With Quote
  #9  
Old 03-19-2005, 04:34 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

ok i fixed it now... YES!
Reply With Quote
  #10  
Old 03-19-2005, 05:29 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
What was wrong with it?
__________________
Reply With Quote
  #11  
Old 03-19-2005, 06:10 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

don't know, but tried it in the real folder and it worked
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Here's a Graphics challenge for you 'experts' zza1pqx Sigs and Graphics 38 04-04-2005 04:31 AM
What u experts think? Stoint Sigs and Graphics 5 01-26-2005 05:43 PM
need help!any experts out there lol? Fanta Delta Force 2 12-01-2004 02:16 PM
European Wargame Experts c00n Gaming Talk 0 04-04-2003 09:51 PM
flash experts could sum1 do this for me........ Protector Sigs and Graphics 26 12-27-2002 11:38 AM


All times are GMT -5. The time now is 08:38 AM.




Powered by vBulletin®