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, 06:56 AM
Admin's Avatar
Administrator
 
Join Date: Jan 2007
Location: Taree
Posts: 607
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
Ultimate Wordpress Commenter

  #2  
Old 01-03-2009, 04: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
Ultimate Wordpress Commenter

Reply

Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anonymous Email Script Admin Free Scripts 15 07-12-2009 04:47 PM
Flash action script criphaze22 Free Scripts 4 07-01-2009 07:19 PM
Uploading Files via FTP Admin Knowledgebase 4 12-07-2008 11:52 PM
Changing File & Folder Permissions CHMOD Admin Knowledgebase 1 04-15-2007 08:18 AM



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

Micro Niche Finder Review - eval gzinflate base64 decode


Forum time zone is GMT. Currently it's 09:37 AM.


Forum SEO | Chrome Plugins

Web Design & SEO Forums