which script make every user like this http://domain.com/$user/
http://domain.com/$user/gallery/
http://domain.com/$user/forum/
etc.. any one know and suggest me...???
Started on the old forum in January 2013 · view the original in the archive · old links redirect here
which script make every user like this http://domain.com/$user/
http://domain.com/$user/gallery/
http://domain.com/$user/forum/
etc.. any one know and suggest me...???
use htaccess, mod rewrite.. http://www.9lessons.info/2009/11/pretty-urls-with-htaccess-file.html look at this tutorial..
It's n0t that i am afraid to die. Its just that if i die, wh0 wilL loVe her as muCh as i Do?
analyzer wrote: 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...
yeah... i ve a script for that. Follow the step bellow. Step 1 [1]: in your config.php add this line
**``` $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.
<?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
require_once('default.php');
**Step 5**: Now in register page if users submited from were ok..before run the sql add this last 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