// Create user’s profile file if (($fp =
// Create user’s profile file if (($fp = fopen($userProfileFile, “w+”)) < 0) { sendErrorPage("Internal Error: Could not create file " . $userProfileFile); exit; } Store the user's details in the profile file. The profile file contains name-value pairs separated by a semicolon: fwrite($fp, "firstname:" . $firstname . "n"); fwrite($fp, "lastname:" . $lastname . "n"); fwrite($fp, "emailaddress:" . $emailaddress . "n"); fwrite($fp, "username:" . $username . "n"); Store the password hash. Generally it is not a good idea to store the user's password in clear text. Instead the hash value of the password can be stored. The hash value of the clear text password can be compared with the stored hash value for authentication. Here we are using "Standard DES encryption with a 2-char SALT" for creating the hash. Note that the crypt() function is a one-way function there is no a decrypt() function. So, there is no way anyone can find the clear text password from the stored hash value: fwrite($fp, "password:" . crypt($password, CRYPT_STD_DES) . "n"); fclose($fp); Create the root folder of the user: // Create users home directory if (createFolder("/", $username) <= 0) { sendErrorPage("Internal Error: Could not create directory " . $username); exit; } Create the mimeTypesfile in the user's root folder. The mimeTypes file is used to store the mime-types of the uploaded file: // Create the mimeTypes file $mimeTypeFile = $username . "/" . "mimeTypes"; if (!fopen(getAbsolutePath($mimeTypeFile), "w+")) { sendErrorPage("Internal Error: Could not create file " . $mimeTypeFile); exit; } ?> Page 259
Note: If you are looking for good and quality webspace to host and run your java application check Actions java hosting services