Results 1 to 4 of 4

Thread: How to create a user registration page and copy files once registered?

  1. #1
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default How to create a user registration page and copy files once registered?

    Hi all , I'm new here.

    K so I am creating a site for people to be able to have their own portfolios to showcase their works (images which they upload)

    I have the jquery files which is the system to show the works. What I need is to create a user registration so that when someone registers, they enter their:

    1. Pick A Username portfolio.com/username

    2. Choose A Password

    3. Retype Your Password

    4. Enter A Valid Email Address

    After they click submit, an email is dispatched to them with an activation link. They activate their account. Once they do. ( By the way this all works on a MYSQL database)

    Once they activate their account, the site would copy the files from directory:

    /home/user/hidden/FILES HERE
    to
    /home/user/public_html/USERNAME

    How would I go about accomplishing this?

    Thanks in advance.

    EDIT: You can see a similiar site here: http://yourprofolio.com/start
    Now thinking about it, to save space it would actually be better if someone could help me out on how to make it so that the portfolios are all hosted from one folder, meaning the system files are in one folder, but the image files for each user are still in their own folders. because copying the portfolio system files to each folder would probably take too much space eventually. So somehow linking it to one folder, yet hosting the images independently on sub folders for each user.
    Last edited by bouncer; 01-29-2011 at 10:21 PM.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Use mkdir() to first make the user folder and give it suitable permissions (0755 for example) and then use copy() to copy files into it.
    If you're moving files permanently though, use the rename() function.

    There's a function here for recursive copying that might help too: http://www.php.net/manual/en/function.copy.php#91010
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    What do you mean permenantly move files to a directory? What I want to do is copy over the files used to host a portfolio. Therefore people would be able to have their own portfolio.

    Could you provide me with an example of how it would work upon user activation? So that once the user activates his account, a directory would be created. Along with the registration. (Not too good in php )

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Code:
    <?php
    
    //.... whatever php code you use to activate your user accounts ....
    
    mkdir("/path/of/directory/to/make", "0755");
    copy("/path/of/source/file.txt", "path/of/destination/file.txt");
    
    //.... other stuff
    
    ?>
    The php manual offers much better examples though so check there -
    copy: http://php.net/manual/en/function.copy.php
    mkdir: http://php.net/manual/en/function.mkdir.php
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •