creating session variables and mod_rewrite

creating session variables and mod_rewrite

am 05.07.2007 21:27:52 von laredotornado

Hi,

I'm using PHP 4.4.4 with Apache 2.2. What I want is that if a
customer visits any page of the top level directory of my site with
this string passed in the URL's query string, "RID=xxx", I would like
a session variable called "RID" with the value "xxx" to be created.
However, I would like to avoid putting this code

session_start();
if (!empty($_REQUEST['RID'])) {
$_SESSION['RID'] = trim(strtoupper($_REQUEST['RID']));
} // if

on every page in my top level directory. Do you know a way I can
use .htaccess files and mod_rewrite to solve this problem?

Thanks, - Dave