Php/mysql Help

Discussion in 'Gaming' started by Misfortune, Dec 30, 2007.

  1. Misfortune

    Misfortune Well-Known Member

    Age:
    34
    Posts:
    318
    Likes Received:
    0
    Joined:
    Jul 13, 2007
    Location:
    Port St. Lucie, FL
    Ok, so I'm not sure if it has a specific name or anything, but I'm trying to find a script or tutorial on how to make it so when a user registers, it will create a link like http://www.url.com/username.

    So here's what I need help with... Is there a specific name to what this is called? What languages are needed in order to do this? Do you know of any tutorials that will help me create this?
     
  2. cosine

    cosine Well-Known Member

    Age:
    31
    Posts:
    63
    Likes Received:
    0
    Joined:
    Mar 25, 2007
    Location:
    Northern Mississippi
    That would create a folder for every single person that registered. If you don't know how to do this already, I don't suggest you do because you're basically holding up a sign that says, "OVER HERE!! HACK ME!!"
     
  3. MattMann

    MattMann Well-Known Member

    Posts:
    334
    Likes Received:
    0
    Joined:
    May 31, 2004
    Location:
    Chicago, IL USA
    This is a script that will do what your asking. It is currently for phpnuke but im sure can be easily modified. The sciprt does a little more than just create the folder, it has some security settings in it also.

    http://www.hotscripts.com/Detailed/68283.html
    Code:
    UploadIt for PHP-Nuke
    
    Description:
    UploadIt 3 integrates with your users accounts, allowing your member to manage there uploaded files. Administrators can delete the files they wish. Set the number of files users can upload to help save server space. The default is 5. Files are automatically renamed to prevent users uploading hacking scripts with names like file.php.zip The last 2 versions did not do this. It automatically creates folders for each user and copies a blank index file in that folder to prevent illegal directory browsing. There is a default upload size of 5MB per file. And for security reasons only .ZIP files have been allowed. Paging is built in so the default page will only show 10 items per page. Fields on upload form include Title, Description, and File.
    The other way to do it is a simple code somewhere during the registration process.
    Code:
    <?PHP
        mkdir("/users/".$user)
    ?>
    You may have some issues with umask and permissions depending on your settings.
     
  4. DarkPrince11

    DarkPrince11 Well-Known Member

    Age:
    31
    Posts:
    772
    Likes Received:
    0
    Joined:
    Mar 22, 2006
    Location:
    Deer Park, New York
    Wow for everyone thinking about directories, you really need to learn a thing or too about mod_rewrite.

    When a website links to http://www.sitename.com/username; they are actually being directed to a sub file such as viewprofile.php?user=username.
    This along with SEO, and other URL modification, is done through the use of mod_rewrite; a module built into Apache.

    First, create a .htaccess file in your root directory. Than place this code into your .htaccess file.

    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule ^([a-zA-Z0-9])/?$ index.php?act=viewprofile&user=$1

    In the above example, whenever a user goes to http://www.yoursite.com/alphacharacterornumber, they will see the profile page of that user. You'll have to modify this to your needs; including what characters to look for and what file to display.
     

Share This Page