Forum Moderators: coopster
I have a site called (for example) www.whatever.com
I want people to create their own pages on www.whatever.com with their own names.
e.g.
www.whatever.com/fred
www.whatever.com/john
www.whatever.com/betty
The above is very easy to do if I create a directory for each user. I DO NOT want to do this. I anticipate 1,000's of users and do not want 1,000's of folders.
I know I can do:
www.whatever.com/index.php?user=fred
www.whatever.com/index.php?user=john
www.whatever.com/index.php?user=betty
But, being a fussy so and so, I don't like this.
Is there a way to use the first example without creating the directories?
Any ideas / suggestions appreciated.
You could have a page template
Copy it within a given dir ex: member
Rename the copied page by using user’s name
Open and write to copied page for ex: $page_name=”fred.php”;
Add a field in DB with page URL www.whatever.com/member/fred.php
Show all or selected URLs, clicking on “fred.php” trigger a query: select from users_table where $page_name=’fred.php’
// Change for letter or number
$randType = rand(1, 2);
// Get an character alone
$type = explode("¦", $type[$randType]);
// Get the total size of characters
$max = count($type);
// Randonic character
$randChar = rand(0, $max);
$code .= $type[$randChar];
}
// Print the rand
echo "the rand generated was: ".$code;
?>
>>>
Plus you need to query for dup to take care of the dup eventuality.
I do not use ID because anyone could figure other ID above and below
although you may use a rewrite to clean the ID #.