<?php
header('Content-Type: application/opensearchdescription+xml');
$url = $_SERVER['SCRIPT_URI'];
$pos = strrpos($url, '/');
$url = substr($url, 0, $pos + 1);
?><?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>PHPture</ShortName>
<Description>Search in my Apple Aperture library</Description>
<Url type="text/html" template="<?php echo($url); ?>?q={searchTerms}" />
<Image height="32" width="32" type="image/png"><?php echo($url); ?>favicon.png</Image>
</OpenSearchDescription>