Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
I need help.How can i create alot of directories
Old 02-25-2009, 06:13 PM I need help.How can i create alot of directories
Junior Talker

Posts: 1
Trades: 0
Hello!
I have a website and every day i must create 100 - 200 new folders manuality in a root directory.
(like: directory100,directory101,directory102....director y200 etc)
I want know if its a method how can i create multiple directories with a php mkdir. So i can just type a url http://mywebsite.com/createdirectoryes.php and it start?
I supose i must use a dinamic variable ( i=i+1 ) or sth like it.
Enyone can help me plz?
A server is php5
Thnx for your time.

Last edited by gjinekollogu; 02-25-2009 at 06:15 PM..
gjinekollogu is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-25-2009, 07:00 PM Re: I need help.How can i create alot of directories
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
If you have a shell access on the machine:
Code:
cd /your/website/root
for i in {1..200}; do mkdir directory$i;done
If php only:
PHP Code:
<?php
$max
=200;
$root=$_SERVER['DOCUMENT_ROOT'];
for(
$i=1;$i<=$max;$i++){
  
mkdir("$root/directory$i");
}
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 02-25-2009 at 07:01 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-25-2009, 08:04 PM Re: I need help.How can i create alot of directories
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I have to ask. Why do you need to create so many directories? 100-200 new directories per day?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 02-25-2009, 09:35 PM Re: I need help.How can i create alot of directories
jason_alan's Avatar
Super Talker

Posts: 100
Name: Jason
Location: Seattle, WA
Trades: 0
Yeah that's gonna get WAY out of control within a few days. Maybe you should use a database? Rethink your application logic
jason_alan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I need help.How can i create alot of directories
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16231 seconds with 12 queries