I am posting the usage below. <? //for url variables $req = new requestGet(); echo "Int:".$req->getVarInt("id")."<br />"; echo "Alpha:".$req->getVarAlpha("name",4)."<br />"; //for form variables $req = new requestPost(); echo "Int:".$req->getVarInt("id")."<br />"; echo "Alpha:".$req->getVarAlpha("name",4)."<br />"; //for cookies $req = new requestCookie(); echo "Int:".$req->getVarInt("id")."<br />"; echo "Alpha:".$req->getVarAlpha("name",4)."<br />"; //for your own variables, set your values to an item in an array and you can modify the array $filter["id"]=4; $filter["name"]="Ali"; $req = new requestFilter($filter); echo "Int:".$req->getVarInt("id")."<br />"; echo "Alpha:".$req->getVarAlpha("name",4)."<br />"; ?> JM 18-May-2005 04:08 The $_SERVER['PHP_AUTH_*'] variables are not available in safe mode. See http://www.php.net/features.http-auth www dot php dot net at webdevelopers dot cz 12-May-2005 09:01 Simple function that selects "best" language for the user from the list of available languages: function chooseLang($availableLangs) { $pref=array(); foreach(split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]) as $lang) { if (preg_match('/^([a-z]+).*?(?:;q=([0-9.]+))?/i', $lang.';q=1.0', $split)) { $pref[sprintf("%f%d", $split[2], rand(0,9999))]=strtolower($split[1]); } } krsort($pref); return array_shift(array_merge(array_intersect($pref, $availableLangs), $availableLangs)); } echo 'BESTLANG: '.chooseLang(array('cs', 'sk', 'ru', 'en')); Daniel "elixon" Sevcik exaton at free dot fr 07-May-2005 02:23 With the arrival of the Google Web Accelerator, the problem of keeping track of users through $_SERVER['REMOTE_ADDR'] (for a much shorter while than with cookies) has reared its ugly head anew. For those confronted with this issue, remember that Google implements the $_SERVER['HTTP_X_FORWARDED_FOR'] header giving the IP address of the connection that it proxies. Hope this helps... inbox at tanasity dot com 13-Apr-2005 09:23 Under Windows 2000, running IIS and PHP 4.3.10, $_SERVER['SCRIPT_NAME'] is not available, however $_SERVER['SCRIPT_FILENAME'] is present and seems to contain the same information. javalizard at mac dot com 11-Apr-2005 07:02 My web host server will give my php the user preferred languages out over the order. This means that I had to write a function for ordering the languages based upon their "q" value (rank from 1..0, 1 being the most preferred). If you want an ordered list of user preferred languages use this function: |