CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 How to autocreate directory at registration?

Print topic Send  topic

Author Message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.