Hey I am completly new at php and pretty much just understand the basics, i was wondering if someone could help me with a form ive been creating to create my directories,
this is what i have so far im creating a free web site submission please help,
thank you,
freeman
<?
function MakeDirectoryName ($username) {
srand ((double) microtime() * 1000000);
$Name = rand() . $username;
return $Name;
}
function WriteToFile ($username, $password) {
$TheFile = "C:\progra~1\abriam~1\apache\htdocs\php\sites.txt";
$Open = fopen ($TheFile, "a");
if ($Open) {
$password = ($password);
$Directory = "C:/progra~1/abriam~1/apache/htdocs/" . MakeDirectoryName ($username);
fwrite ($Open, "$username\t$password\t$Directory\n");
fclose ($Open);
if(! is_dir($Directory.$current_dir) ) {
mkdir($Directory.$current_dir,0700);
$Directory = TRUE;
}
} else {
$Directory = FALSE;
}
return $Directory;
}
?>
<HEAD>
<TITLE>Welcome New User</TITLE>
<BODY>
<?
if (($Array[username]) && ($Array[password])) {
$Check = WriteToFile ($Array[username], $Array[password]);
if ($Check) {
print ("Your request was successfully processed!<BR>\n");
} else {
print ("Your request was not processed due to a system error!\n");
}
} else {
print ("Please enter a Username and Password!\n");
}
?>
</BODY>