--- In [email protected], "Marian Briones" <[EMAIL PROTECTED]> 
wrote:
> Hi -
> 
> I got it all solved without the symlink.  What I was trying to do 
was
> to let a registered member create their own virtual webspace.  Say I
> want to be able to display my profile to someone if they go to the 
url
> www.mymembershipsite/catlady
> 
> Catlady is my chosen name for this thing; myspace.com does this
> actually.  It was deciding how that was going to work.  I found the
> .htaccess Rewrite Rules solved this for me.  I merely have it append
> the user's desired namd (after checking for duplicity) and appending
> it to the .htaccess file. 
> 
> The thing for me to think about later is if a user is deleted, I'll
> have to manually rewrite the .htaccess file, but I can see storing
> that information in another database table and writing it out if 
that
> happens (something to think of).
> 
> Thanks for everyone's help on this. I learned a lot and I hope I can
> pass the things I learn here onto others.
> 
> Marian

Marian

Here is a process I use with great results. There are several files 
involved so they can be used on multiple pages.

First, the .htaccess file to convert a URL into an Associate ID:
RewriteEngine On
Options FollowSymLinks
# make all html files act like PHP files
AddType application/x-httpd-php .html

# If request is not for html, htm, php, txt, gif, jpeg, jpg, or png 
files
RewriteCond %{REQUEST_URI} !\.(html?|php|txt|gif|jpe?
g|png|css|js|inc|tpl|doc|pdf|csv|ppt)$
# and if the current query string does not include an aff id
RewriteCond %{QUERY_STRING} !r=
# 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 (.*) /?r=$1 [QSA,L]

/* /inc/requestref.php
Get refid and create session to prevent jumping into other associate 
sites. Put this and the other included files into a .htaccess 
protected includes 'inc' folder.
*/
<?php
// Select the request variable r. If blank or missing set to 3000.
if(isset($_SESSION["r"]))  {
$r = $_SESSION["r"];
 }
elseif(!isset($_SESSION["r"])) {
session_register("r");
if(!$_REQUEST["r"]) { $_SESSION["r"] = "3000"; }
else {
$_SESSION["r"] = $_REQUEST["r"];
}
 }
else  {
session_register("r");
$_SESSION["r"] = "3000";
 }
$sid = session_id();
?>

/* /inc/1-top.html to be included in all pages */
<?php
@require($_SERVER["DOCUMENT_ROOT"]."/inc/db.php");
$MemQuery = mysql_query("SELECT * FROM associates WHERE uid='".$r."' 
LIMIT 1");
if(!$MemQuery) {
die();
}
while($row = mysql_fetch_array($MemQuery)) {
$mem_id = $row["uid"];
$mem_fname = $row["firstname"];
$mem_lname = $row["lastname"];
/* 
phone number is split into 3 parts in the database for sorting and 
searching the area code and prefixes
*/
$mem_phone = $row["day_areacode"]."-".$row["day_prefix"]."-".$row
["day_suffix"];
$mem_email = $row["email"];
}
?>

/* index.html */
<?php session_start();
@require($_SERVER["DOCUMENT_ROOT"]."/inc/requestref.php");
?>
<!-- the rest of your page goes here -->

Hope this helps.

Jim Hutchinson
http://www.websitemanagers.net







------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hu8l50d/M=362329.6886308.7839368.1510227/D=groups/S=1705005703:TM/Y=YAHOO/EXP=1123541212/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

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/
 



Reply via email to