Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

66 users online



Registration With Folder Copy

Registration With Folder Copy

Currently viewing this thread: 1 (0 members and 1 guests)


trigxine

trigxine

Baton-twirling in the parade of color.
Status: Offline!

Registration With Folder Copy

Hmm.. it might seem a bit naive of me, but does anyone know of a script that's out there that will allow users to register, and then once they're registered, automatically create them a "home" directory with predefinied initial contents?

As in...
When a user registers, a folder containing an image upload script is copied to their "home" folder, and they, on their user page, are transferred to that script for image uploads....

It seems almost like a combination of three scripts... I already have the image upload one written.

___________________

http://www.whatislime.com/hosted/sigs/1.gif
http://www.whatislime.com/hosted/sigs/2.gif
http://www.whatislime.com/hosted/sigs/3.gif

KoolAsIce

KoolAsIce

Status: Offline!

use the mkdir(); function.. something like

PHP:

<?php
mkdir 
("/$username"0777);
?>

and then use fwrite() to create the file

___________________

http://80.255.219.99/~Scott/signature.gif

Shahrukh

Shahrukh

Neverside Newbie
Status: Offline!

I just searched and came up with this thread, expanding on the above, how would you limit the users to a certain amount of space. For example, say I wanted to limit each new folder to 1mb. Smile

v3x0rg

v3x0rg

Pawn Coder
Status: Offline!

Well, where is it?Tongue

___________________

- Moderator at the official AMX Mod X forums

dafrabbit

dafrabbit

Neverside Newbie
Status: Offline!

Well before your script actually goes through with the users' request, if the request will take up space, then run a check for how much the user has used:

PHP:

<?php

$dir 
"."//Change of course
$dp opendir($dir);
while(
$file readdir($dp))
{
    if(
$file != "." && $file != "..")
    {
         
$folderuse $folderuse filesize($file);
    }
}
closedir($dp);
if(
$folderuse >= 1000000)  //Remember....this is always in BYTES!
{
    
//Sorry! Over 1 meg!
}
else
{
    
//Go on...
}

?>


The script there has a problem though....it doesn't check whether the action the user is about to take could go over 1 meg. If it's an upload, just do something like:

$folderuse = $folderuse + $_FILES['file']['filesize']

And run the check.

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0084 seconds.