Log in

View Full Version : Subdirectory Creation upon Registration


defi
03-23-2005, 12:10 AM
Okay, basically, what I'm trying to do is autocreate a subdirectory of the user's registered username which is created after activation on vbulletin 3.0.7;

In register, I placed this code:
//make directory
mkdir($username, 0777);

in between:
// activate account
$username = unhtmlspecialchars($userinfo['username']);

and,
if ($vboptions['welcomemail'] AND !$userinfo['posts'])
{
eval(fetch_email_phrases('welcomemail'));
vbmail($userinfo['email'], $subject, $message);
}

The problem is that it doesn't create the directory at all - no errors even pop-up when the account is registered and confirmed???

Does anyone have any ideas or suggestions?

cinq
03-23-2005, 12:42 AM
You have to define the path in which you want the directory ( with the username ) created :)

sabret00the
03-23-2005, 08:30 AM
You have to define the path in which you want the directory ( with the username ) created :)
told him so as much on aim last night, then i woke up to see a message that he sorted it.

i suggested;
//make directory
mkdir($username, 0777);


should've been
//make directory
$path = "/home/sitename/html/forums/" . $username;
mkdir($path, 0777);

but not sure if that code worked for him or no.

defi
03-23-2005, 04:59 PM
It got me on the right path,however, I did the following code through my own research;
//make directory PLEASE...
mkdir("/home/thatcomm/public_html/$username");
chmod("/home/thatcomm/public_html/$username", 0777);
Which basically is defining the register.php to make a new directory based off the registered username, and then in turn chmod it to make a new redirect index.php file being created in that same directory using an fopen and fwrite variable(s).

The code works, however when the page goes to insert the redirection code, because of the Javascript nature of the redirect, I get a parse error - I'm probably going to have to make it stripslashes and insert it from a default field in a MySQL table. We'll see.