--- In [email protected], "Marian Briones" <[EMAIL PROTECTED]>
wrote:
> Hi gang
> I'm almost done with this site I'm doing. It is a membership
site, so
> part of it is they choose a membername so someone can bringup their
> profile easily - www.thesite.com/membername
>
> So, it does a mkdir and now I have to have it also write an
index.php
> page that will bring up their profile when someone goes to that
URL.
>
> The question is, what's the best way to do this? I literally have
to
> write php with php. would I use $filepointer and a bunch of fopen
> statements? Would I have to use ASCI characters (ampersand gt for
> instance to create an opening bracket?
>
> I **don't** want to write static pages.
>
> Suggestions?
>
> Thanks
>
> Marian
I started a site that used the mkdir() for each member and ran into
a serious problem when the number of members reached 900+ on a Linux
system. Apparently Linux has a limit to the number of files in a
folder. Once the limit is reached, bad things happen, like the
server refuses to serve any of the pages.
So I developed a work-around using mod_rewrite and a
single .htaccess file in the parent folder. One thing you need to
watch for is the file extension. If it's not in the list, the page
will show an error message. Replace the 'IBA' with the variable name
you use to track members, such as 'r'.
Sample .htaccess file:
RewriteEngine On
Options FollowSymLinks
# If request is not for html, htm, php, txt, gif, jpeg, jpg, png,
# exe, mp3, ram, etc files
RewriteCond %{REQUEST_URI} !\.(html?|php|txt|gif|jpe?
g|png|css|js|inc|csv|tpl|doc|pdf|exe|zip|ram|rm|wma|mp3|ppt)$
# and if the current query string does not include an aff id
RewriteCond %{QUERY_STRING} !IBA=
# and the requested resource does not exist as a directory
RewriteCond %{REQUEST_FILENAME} !-d
# append aff query string to URL and any existing query string
RewriteRule (.*) /?IBA=$1 [QSA,L]
Upload the file in ASCII mode to your parent folder (httpdocs, www,
etc) and name it .htaccess
Now go to www.thesite.com/membername and watch it become
www.thesite.com/?r=membername See a live site using it here:
http://www.ffps.tv/home
Jim Hutchinson
Website Managers, LLC
http://www.websitemanagers.net
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/