[Phpwm] Php Script

Phil Beynon phil at infolinkelectronics.co.uk
Thu May 25 11:10:46 BST 2006


> Hi,
> ----- Liam <liam at datasave.ltd.uk> wrote:
> > Hi There,
> > 
> > ive now completed this, This is what i wrote,
> 
> Great!
> 
> Just so you know you're using a mix of two loop styles:
> 
> The for loop style;
> 
> <?
> 
> for ($directory = 5800; $directory <= 10210; $directory++) {
>   mkdir("C:\BigApache\Apache\htdocs\test\\" + $directory, 0777);
>   echo $directory;
> }
> 
> ?>
> 
> Or the while loop style;
> 
> <?
> 
> $directory = 5800;
> 
> while ($directory <= 10210) {
>   mkdir("C:\BigApache\Apache\htdocs\test\\" + $directory, 0777);
>   echo $directory;
>   $directory++;
> }
> 
> ?>
> 
> Which style you prefer is up to you, although there are certain 
> situations where the where style is more flexible.
> 
> Regards,
> 
> Paul
> 

Liam,
You also really should do a check on if the mkdir command succeeded as well.

Having 777 directory permissions is ok on a development machine, but its a bit risky on a production server, unless you absolutely need it to be that then you should think about reducing it a bit.


Regards,

Phil Beynon
Sales director

** http://www.diygear.com THE Online DIY Toolstore For DIY & Business
** Infolink Electronic Systems Ltd. http://www.infolinkelectronics.co.uk
** Professional Web Design & Cobalt Hosting Solutions
** Contact: Sales at infolinkelectronics.co.uk
** Tel / Fax 0121 458 4894 (office) 0121 441 3558 (home) 07801 548464 (mobile)




More information about the Phpwm mailing list