ispwebhosting4u
Posts: 17
|
Posted: 01/27/2004, 1:00 PM |
|
I was doing some looking around trying to find an answer to a similar question. I came up with a CCS+PHP+MySQL answer. I have found that it works on both Windows XP+Apache and Linux.
I placed my code in the 'After Initialize' event on the form where users can upload images. After I get existing users updated, I will probably move my custom code to the registration page, so it gets created when they signup. I may even turn it into a function.
The administrator also gets to upload images for users, so I have mine look up the user's login name in the database instead of just using CCGetUserLogin()
Here is the code:
global $recordForm;
$db = new clsDBconnection1();
$accountID = CCGetParam('user_id');
if ($accountID)
{
$accountName = CCdlookup("user_login","users","user_id=".$accountID,$db);
$filePath = './uploads/'.$accountName;
if (!file_exists($filePath))
{
mkdir($filePath, 0777);
}
$recordForm->upload_component->FileFolder = $filePath."/";
}
Hope this helps someone.
_________________
Rick Page
PageHosting4U.com |