<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=User%3ACraftish_Resident%2Fphp%2FSLRequestData</id>
	<title>User:Craftish Resident/php/SLRequestData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=User%3ACraftish_Resident%2Fphp%2FSLRequestData"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Craftish_Resident/php/SLRequestData&amp;action=history"/>
	<updated>2026-04-06T17:35:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Craftish_Resident/php/SLRequestData&amp;diff=1196196&amp;oldid=prev</id>
		<title>Craftish Resident at 09:30, 18 April 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Craftish_Resident/php/SLRequestData&amp;diff=1196196&amp;oldid=prev"/>
		<updated>2015-04-18T09:30:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:30, 18 April 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;slrequestdata.php&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;slrequestdata.php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;php&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source lang=&quot;&lt;/ins&gt;php&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l130&quot;&gt;Line 130:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 130:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;php&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Craftish Resident</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Craftish_Resident/php/SLRequestData&amp;diff=1176784&amp;oldid=prev</id>
		<title>Craftish Resident: PHP script for reading SL http request headers</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Craftish_Resident/php/SLRequestData&amp;diff=1176784&amp;oldid=prev"/>
		<updated>2013-02-16T11:01:28Z</updated>

		<summary type="html">&lt;p&gt;PHP script for reading SL http request headers&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Optimized Second Life HTTP request header-reading class for php&lt;br /&gt;
&lt;br /&gt;
Doesn&amp;#039;t process headers unless they are used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
slrequestdata.php&lt;br /&gt;
&amp;lt;php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/* *** -------------------------------------------------- *** */&lt;br /&gt;
/* ***      Copyright (c) 2013 by Craftish Resident       *** */&lt;br /&gt;
/* *** Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) *** */&lt;br /&gt;
/* ***   http://creativecommons.org/licenses/by-sa/3.0/   *** */&lt;br /&gt;
/* *** -------------------------------------------------- *** */&lt;br /&gt;
&lt;br /&gt;
class SLRequestData{&lt;br /&gt;
	private static $object_grid=FALSE;&lt;br /&gt;
	private static $object_name=FALSE;&lt;br /&gt;
	private static $object_key=FALSE;&lt;br /&gt;
	private static $object_pos=FALSE;&lt;br /&gt;
	private static $object_vel=FALSE;&lt;br /&gt;
	private static $object_rot=FALSE;&lt;br /&gt;
	private static $owner_key=FALSE;&lt;br /&gt;
	private static $owner_name=FALSE;&lt;br /&gt;
	private static $region_data=FALSE;&lt;br /&gt;
	private static $region_name=FALSE;&lt;br /&gt;
	private static $region_pos=FALSE;&lt;br /&gt;
	//&lt;br /&gt;
	private static $apachecheck=FALSE;&lt;br /&gt;
	private static $apache=FALSE;&lt;br /&gt;
	private static $headers;&lt;br /&gt;
	//&lt;br /&gt;
	private static function header_get($x){&lt;br /&gt;
		return array_key_exists($x,self::$headers)?self::$headers[$x]:&amp;#039;&amp;#039;;&lt;br /&gt;
	}&lt;br /&gt;
	public static function header($x) {&lt;br /&gt;
		if(self::$apachecheck===FALSE){&lt;br /&gt;
			self::$apache=function_exists(&amp;#039;apache_request_headers&amp;#039;);&lt;br /&gt;
			self::$headers=self::$apache?apache_request_headers():$GLOBALS[&amp;#039;HTTP_ENV_VARS&amp;#039;];&lt;br /&gt;
			self::$apachecheck=TRUE;&lt;br /&gt;
		}&lt;br /&gt;
		switch($x):default:&lt;br /&gt;
			return &amp;#039;&amp;#039;;&lt;br /&gt;
		break;case &amp;#039;object_grid&amp;#039;:&lt;br /&gt;
			return (self::$object_grid!==FALSE)?(self::$object_grid):(self::$object_grid=self::header_get(self::$apache?&amp;#039;X-SecondLife-Shard&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_SHARD&amp;#039;));&lt;br /&gt;
		break;case &amp;#039;object_name&amp;#039;:&lt;br /&gt;
			return (self::$object_name!==FALSE)?(self::$object_name):(self::$object_name=self::header_get(self::$apache?&amp;#039;X-SecondLife-Object-Name&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_OBJECT_NAME&amp;#039;));&lt;br /&gt;
		break;case &amp;#039;object_key&amp;#039;:&lt;br /&gt;
			return (self::$object_key!==FALSE)?(self::$object_key):(self::$object_key=self::header_get(self::$apache?&amp;#039;X-SecondLife-Object-Key&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_OBJECT_KEY&amp;#039;));&lt;br /&gt;
		break;case &amp;#039;object_pos&amp;#039;:&lt;br /&gt;
			if(self::$object_pos!==FALSE)return self::$object_pos;&lt;br /&gt;
			$temp1=self::header_get(self::$apache?&amp;#039;X-SecondLife-Local-Position&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_LOCAL_POSITION&amp;#039;);&lt;br /&gt;
			$temp2;&lt;br /&gt;
			preg_match_all(&amp;#039;#\(([\d.]+), ([\d.]+), ([\d.]+)\)#i&amp;#039;,$temp1,$temp2);&lt;br /&gt;
			return self::$object_pos=@array(&amp;#039;x&amp;#039;=&amp;gt;(float)$temp2[1][0],&amp;#039;y&amp;#039;=&amp;gt;(float)$temp2[2][0],&amp;#039;z&amp;#039;=&amp;gt;(float)$temp2[3][0]);&lt;br /&gt;
		break;case &amp;#039;object_vel&amp;#039;:&lt;br /&gt;
			if(self::$object_vel!==FALSE)return self::$object_vel;&lt;br /&gt;
			$temp1=self::header_get(self::$apache?&amp;#039;X-SecondLife-Local-Velocity&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_LOCAL_VELOCITY&amp;#039;);&lt;br /&gt;
			$temp2;&lt;br /&gt;
			preg_match_all(&amp;#039;#\(([\d.]+), ([\d.]+), ([\d.]+)\)#i&amp;#039;,$temp1,$temp2);&lt;br /&gt;
			return self::$object_vel=@array(&amp;#039;x&amp;#039;=&amp;gt;(float)$temp2[1][0],&amp;#039;y&amp;#039;=&amp;gt;(float)$temp2[2][0],&amp;#039;z&amp;#039;=&amp;gt;(float)$temp2[3][0]);&lt;br /&gt;
		break;case &amp;#039;object_rot&amp;#039;:&lt;br /&gt;
			if(self::$object_rot!==FALSE)return self::$object_rot;&lt;br /&gt;
			$temp1=self::header_get(self::$apache?&amp;#039;X-SecondLife-Local-Rotation&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_LOCAL_ROTATION&amp;#039;);&lt;br /&gt;
			$temp2;&lt;br /&gt;
			preg_match_all(&amp;#039;#\(([\d.]+), ([\d.]+), ([\d.]+), ([\d.]+)\)#i&amp;#039;,$temp1,$temp2);&lt;br /&gt;
			return self::$object_rot=@array(&amp;#039;x&amp;#039;=&amp;gt;(float)$temp2[1][0],&amp;#039;y&amp;#039;=&amp;gt;(float)$temp2[2][0],&amp;#039;z&amp;#039;=&amp;gt;(float)$temp2[3][0],&amp;#039;s&amp;#039;=&amp;gt;(float)$temp2[4][0]);&lt;br /&gt;
		break;case &amp;#039;owner_key&amp;#039;:&lt;br /&gt;
			return (self::$owner_key!==FALSE)?(self::$owner_key):(self::$owner_key=self::header_get(self::$apache?&amp;#039;X-SecondLife-Owner-Key&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_OWNER_KEY&amp;#039;));&lt;br /&gt;
		break;case &amp;#039;owner_name&amp;#039;:&lt;br /&gt;
			return (self::$owner_name!==FALSE)?(self::$owner_name):(self::$owner_name=self::header_get(self::$apache?&amp;#039;X-SecondLife-Owner-Name&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_OWNER_NAME&amp;#039;));&lt;br /&gt;
		break;case &amp;#039;region_data&amp;#039;:&lt;br /&gt;
			return (self::$region_data!==FALSE)?(self::$region_data):(self::$region_data=self::header_get(self::$apache?&amp;#039;X-SecondLife-Region&amp;#039;:&amp;#039;HTTP_X_SECONDLIFE_REGION&amp;#039;));&lt;br /&gt;
		break;case &amp;#039;region_name&amp;#039;:&lt;br /&gt;
			if(self::$region_name!==FALSE)return self::$region_name;&lt;br /&gt;
			$temp1=self::header(&amp;#039;region_data&amp;#039;);&lt;br /&gt;
			$temp2;&lt;br /&gt;
			preg_match_all(&amp;#039;#([\w ]*)\s\((\d+), (\d+)\)#i&amp;#039;,$temp1,$temp2);&lt;br /&gt;
			self::$region_pos=@array(&amp;#039;x&amp;#039;=&amp;gt;(float)$temp2[2][0],&amp;#039;y&amp;#039;=&amp;gt;(float)$temp2[3][0]);&lt;br /&gt;
			return self::$region_name=@$temp2[1][0];&lt;br /&gt;
		break;case &amp;#039;region_pos&amp;#039;:&lt;br /&gt;
			if(self::$region_pos!==FALSE)return self::$region_pos;&lt;br /&gt;
			$temp1=self::header(&amp;#039;region_data&amp;#039;);&lt;br /&gt;
			$temp2;&lt;br /&gt;
			preg_match_all(&amp;#039;#([\w ]*)\s\((\d+), (\d+)\)#i&amp;#039;,$temp1,$temp2);&lt;br /&gt;
			self::$region_name=@$temp2[1][0];&lt;br /&gt;
			return self::$region_pos=@array(&amp;#039;x&amp;#039;=&amp;gt;(float)$temp2[2][0],&amp;#039;y&amp;#039;=&amp;gt;(float)$temp2[3][0]);&lt;br /&gt;
		break;case &amp;#039;print_r&amp;#039;:&lt;br /&gt;
			return print_r(array(&lt;br /&gt;
				&amp;#039;object_grid&amp;#039;=&amp;gt;self::header(&amp;#039;object_grid&amp;#039;),&lt;br /&gt;
				&amp;#039;object_name&amp;#039;=&amp;gt;self::header(&amp;#039;object_name&amp;#039;),&lt;br /&gt;
				&amp;#039;object_key&amp;#039;=&amp;gt;self::header(&amp;#039;object_key&amp;#039;),&lt;br /&gt;
				&amp;#039;object_pos&amp;#039;=&amp;gt;self::header(&amp;#039;object_pos&amp;#039;),&lt;br /&gt;
				&amp;#039;object_vel&amp;#039;=&amp;gt;self::header(&amp;#039;object_vel&amp;#039;),&lt;br /&gt;
				&amp;#039;object_rot&amp;#039;=&amp;gt;self::header(&amp;#039;object_rot&amp;#039;),&lt;br /&gt;
				&amp;#039;owner_key&amp;#039;=&amp;gt;self::header(&amp;#039;owner_key&amp;#039;),&lt;br /&gt;
				&amp;#039;owner_name&amp;#039;=&amp;gt;self::header(&amp;#039;owner_name&amp;#039;),&lt;br /&gt;
				&amp;#039;region_data&amp;#039;=&amp;gt;self::header(&amp;#039;region_data&amp;#039;),&lt;br /&gt;
				&amp;#039;region_name&amp;#039;=&amp;gt;self::header(&amp;#039;region_name&amp;#039;),&lt;br /&gt;
				&amp;#039;region_pos&amp;#039;=&amp;gt;self::header(&amp;#039;region_pos&amp;#039;),&lt;br /&gt;
			),TRUE);&lt;br /&gt;
		break;case &amp;#039;headers&amp;#039;:&lt;br /&gt;
			return print_r(self::$headers,TRUE);&lt;br /&gt;
		break;endswitch;&lt;br /&gt;
		return &amp;#039;&amp;#039;;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
header(&amp;#039;Content-Type: text/plain&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
include &amp;#039;slrequestdata.php&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Hello &amp;quot; . SLRequestData::header(&amp;#039;owner_name&amp;#039;) . &amp;quot;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Outputs: Hello Craftish Resident&lt;br /&gt;
&lt;br /&gt;
$pos = SLRequestData::header(&amp;#039;object_pos&amp;#039;);&lt;br /&gt;
echo SLRequestData::header(&amp;#039;object_name&amp;#039;) . &amp;quot;&amp;#039;s z position is {$pos[&amp;#039;z&amp;#039;]}&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Outputs: Object&amp;#039;s z position is 1400.5&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/php&amp;gt;&lt;/div&gt;</summary>
		<author><name>Craftish Resident</name></author>
	</entry>
</feed>