user file/folder script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    user file/folder script

    which script make every user like this
    http://domain.com/$user/

    http://domain.com/$user/gallery/

    http://domain.com/$user/blog/

    http://domain.com/$user/forum/

    etc.. any one know and suggest me...???
    Last edited by rajivmeg; 21.01.13, 03:42.

    #2
    any script with mod rewrite

    Comment


      #3
      use htaccess, mod rewrite.. http://www.9lessons.info/2009/11/pre...cess-file.html look at this tutorial..
      Last edited by analyzer; 21.01.13, 12:58.
      It's n0t that i am afraid to die. Its just that if i die, wh0 wilL loVe her as muCh as i Do?

      Comment


        #4
        Originally posted by analyzer View Post
        use htaccess, mod rewrite.. Pretty URLs with .htaccess Rewriting Tips. look at this tutorial..
        not only .htaccess I need full script. I have one. like 4wap but I want more.. attach some this type of PHP script or post some link...

        Comment


          #5
          yeah... i ve a script for that. Follow the step bellow.
          [b]Step 1 [1]: in your config.php add this line
          Code:
          $SourceDir = 'source';

          Step 2: create a new dir (source) in ur host.


          Step 3: now create a new file (default.php) in ur public html.

          Code:
          <?php
              
              function recurse_copy($src,$dst) { // recursive function that copy files from one directory to another
              $dir = opendir($src);
              @mkdir($dst);
              while(false !== ( $file = readdir($dir)) ) {
              if (( $file != '.' ) && ( $file != '..' )) {
              if ( is_dir($src . '/' . $file) ) {
              recurse_copy($src . '/' . $file,$dst . '/' . $file);
              }
              else {
              copy($src . '/' . $file,$dst . '/' . $file);
              }
              }
              }
              closedir($dir);
              //echo "$src";
              }
          
          function remote_mkpath($server, $path)  {
                  $dirs = array();
                  $path = preg_replace('/(\/){2,}|(\\\){1,}/','/',$path); //only forward-slash
                  $dirs = explode("/", $path);
                  $path = "\\\\" . $server . "/";
                  $i = 0;
                  foreach ($dirs AS $element) {
                      $path .= $element . "/";
                      if(!is_dir($path) && $i != 0) {
                          if(!mkdir($path)){
                              echo "something was wrong at : " . $path;
                              return 0;
                          }
                      }  
                      $i++;
                  }
                  return true;
                  echo $path;
          }
              ?>

          Step 4 : now on the top of ur register.php put this line

          Code:
          require_once('default.php');
          Step 5: Now in register page if users submited from were ok..before run the sql add this last code

          Code:
           mkdir(dirname(__FILE__)."/"."$username"); // Create Directory
          recurse_copy($SourceDir,$username); // Copy files from source directory to target directory
          this will make a subfolder for every new registered user.


          change the value "$username" according ur register value.


          Note: at step 2 where you made a new dir (source) in that dir create a index.php and put ur users data.

          this script will automatic make a subfolder as username and automatic copy the index.php from the (source) dir. even u can add more php file or image for auto copy in @username@ folder

          Comment


            #6
            can u attach your script with following method. with .htaccess support. its request

            Comment

            Working...
            X