Posts

Showing posts with the label PHP

Reading headers in a PHP script

When an http request is made from a script within a secondlife to an external web server, the simulator adds some headers such as X-Secondlife-Shard or X-Secondlife-Owner-Key. In this way I save the work of having to send that data in the POST. There are many examples doing a few searches. One of the most popular codes uses a huge "if" to distinguish when the variables arrive in Apache form or arrive entirely in uppercase with the prefix "HTTP_". I distrust that solution for being Spaghetti code. Another more elegant solution reimplements the apache_request_headers () function by checking before it does not exist. Only one problem, in my environment it does not work. This function is implemented but the headers from secondlife are in uppercase format. Finally I had to create my own version. I include the code of two PHP scripts and an lsl script. File: slHeaders.php    The following file is included as is on the web server < ? PHP class SlData ...