Go Back   Web Design & SEO Company > Free Scripts

Free Scripts Free Scripts to add to your website, includes Ajax, Javascript, php, Flash, CSS, HTML and more. No registration is required to download, these scripts are provided free to help you make the most of your website.

Reply
 
  #1  
Old 12-03-2008, 07:56 AM
Admin's Avatar
Administrator
 
Join Date: Jan 2007
Location: Taree
Posts: 613
Default Script to CHMOD Multiple Files via Browser

This is a really quick and simple script that will enable you to CHMOD large amounts of files and folders directly via your browser. Recently i had to install a script, and without exaggeration it required in excess of 100 files/folders to be set to various CHMOD permission levels.

Very tedious indeed switching back and forwards between CuteFTP and translated install documents trying to work out what files need 666, 777 when they weren't even in order and making sure none were missed. So.. I done a quick script, then used a quick macro and find/replace in Notepad++ to add all the file names in to the script in 2 minutes, run it in the browser and the lot was done.

This is a quick demo of the output when run, it has basic error reporting and i purposely botched one file up to show a failed result:



This is the code, feel free to modify it and as you can see it's pretty simple:

PHP Code:
<?php
// Simple CHMOD www.tareeinternet.com
$chmod_777 = array();
$chmod_777[] ='./admin/';
$chmod_777[] ='./admin/keywords.txt';
$chmod_777[] ='./admin/install/';

$chmod_666 = array();
$chmod_666[] ='./admin/config.php';
$chmod_666[] ='./admin/database.txt';
$chmod_666[] ='./admin/words.txt';


for ( 
$i 0$i count($chmod_777); $i++ )
{
   if (!
chmod ($chmod_777[$i], 0777))
   {
       echo 
'<font color="#DD3333"><b>Oops cannot change permission of (' $chmod_777[$i] . ')</b></font><br />';
   }
   else
   {
       echo 
'<font color="#228844"><b>Woot chmodded (' $chmod_777[$i] . ')</b></font><br />';
   }
}

for ( 
$i 0$i count($chmod_666); $i++ )
{
   if (!
chmod ($chmod_666[$i], 0666))
   {
       echo 
'<font color="#DD3333"><b>Oops cannot change permission of (' $chmod_666[$i] . ')</b></font><br />';
   }
   else
   {
       echo 
'<font color="#228844"><b>Woot chmodded (' $chmod_666[$i] . ')</b></font><br />';
   }
}

?>
To use, save it as chmod.php then upload it to your public_html and execute it by going to Domain.com/chmod.php
Reply With Quote
Top SEO Tool
Harvester and Mass Blog Commenter
Blog Comment Software

  #2  
Old 01-03-2009, 05:34 AM
Junior Member
 
Join Date: Jan 2009
Posts: 2
Default How to change the chmod at localhost?

I try to run the script at my pc(localhost) but how can we change the file chmod it? Because some file need chmod 777 to run.
Reply With Quote
Top SEO Tool
Harvester and Mass Blog Commenter
Blog Comment Software

Reply

Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Job Script Benivolent Free Scripts 0 04-17-2010 06:58 AM
Need Help With Script mrB Free Scripts 1 08-11-2009 08:17 PM
Saving files from the internet to an online backup account? krishgayle Knowledgebase 2 07-20-2009 06:57 PM
hi all need help in decode php files arabdecoder Knowledgebase 0 03-17-2009 05:51 AM
Uploading Files via FTP Admin Knowledgebase 4 12-08-2008 12:52 AM
Changing File & Folder Permissions CHMOD Admin Knowledgebase 1 04-15-2007 08:18 AM



Knowledgebase | SEO | Free Scripts | Free Wordpress Themes | Free Graphics

eval gzinflate base64 decode | SEO Addons


Forum time zone is GMT. Currently it's 10:21 PM.

SEO - Top



Web Design & SEO Forums