PDA

View Full Version : On user create add folder.


Rofflecopter
04-19-2006, 02:50 AM
Can anyone write a script for me that makes it so that when someone registers it creates a folder under your URL. Like if SeniorBilly registered, as well as becoming a member it would make http://www.mysite.com/SeniorBilly
Also, when it's created, there'd need to be some files already in there. Can anyone point me in the right direction or code it for me? I'd greatly appreciate it. <3

guelphdad
04-19-2006, 02:54 AM
This is not a mysql question and belongs in a different forum.

Rofflecopter
04-19-2006, 02:55 AM
The registration system is managed by MySQL. I don't see how it isn't. =/

raf
04-19-2006, 08:44 AM
The registration system is managed by MySQL. I don't see how it isn't. =/
Welcome here!

what you describe requires the use of a server side language (PHP, ASP, JSP, ...) so you should post in a server side language forum.

I doubt if someone will code this for free. Not because the ammount of work it would take (verry limited), but because you'll probably wount get it working without someone talking you through every step of the way (which usually is a verry time-consuming and frustrating activity)...

DR.Wong
04-19-2006, 09:17 AM
hey. here is something to get you started:
<?php mkdir("$nameofuser"); ?>
This will create a new folder in the directory that the script is located in.

You could just assign a variable called $nameofuser when he/she registers and then include it in the page that adds the info into your MySQL Table.
Not too hard... but you are on your own when it comes to the files already existing.

Try googling your problem. Maybe you can create a 'template' directory with the files inside and then get a script to copy the folder and then rename it respectively.

Good luck!

guelphdad
04-19-2006, 03:42 PM
The registration system is managed by MySQL. I don't see how it isn't. =/

It isn't because what you want to do is not done in sql it is done in an application language as stated above.

If you want to know how to do a query or manage your data in your table then you would post in an sql forum.

You would also get more people better versed in whatever language you use if you post in that forum. For instance I know php marginally well, perl I'm out of touch with and can probably do something in java or c or c++ if you held a gun to my head. I'm very well versed in sql, particularly mysql.

So for me for instance I'd probably be able to help you with something in php involving mysql, but you are better off posting in that forum, when the majority of what you want done can be handled by people better versed in php.

You wouldn't take your car to an interior design store to have them look at your engine merely because you had expensive one-off designer slip covers for your seats right?

Rofflecopter
04-20-2006, 01:49 AM
hey. here is something to get you started:
<?php mkdir("$nameofuser"); ?>
This will create a new folder in the directory that the script is located in.

You could just assign a variable called $nameofuser when he/she registers and then include it in the page that adds the info into your MySQL Table.
Not too hard... but you are on your own when it comes to the files already existing.

Try googling your problem. Maybe you can create a 'template' directory with the files inside and then get a script to copy the folder and then rename it respectively.

Good luck!
Thanks a lot! :D That's all I really needed, and I couldn't find the answer via google... or ask... or yahoo... so I came here. Thanks a lot, again.

raf
04-20-2006, 09:07 AM
That's all I really needed, and I couldn't find the answer via google... or ask... or yahoo... so I came here.
maybe you only have the 'light' version of google installed, since "PHP create directory" and "PHP copy files" return loads of hits with complete examplecode.
If you for instance look at http://uk.php.net/copy , then you'll find plenty of functions to copy a complete directory and set its permissions...

DR.Wong
04-20-2006, 10:50 AM
No prob.

If you still go ahead with the thing of having files already existing in the directory after you create it, let us know how you went about it. It will be interesting to see...

Search for the copy function on google, I think that will aid you the most in placing files automatically.

Once again. Good luck.