protected function redirect($path) { // Construct the url parts $protocol = $_SERVER['HTTPS'] ? 'https' : 'http'; $host = preg_match('%^http://|https://%', $path) > 0 ? '' : "{$protocol}://" . $_SERVER['HTTP_HOST']; $uri = rtrim($this->baseUrl(), '/'); // Perform the redirect SH_Http::redirect("{$host}{$uri}{$path}"); }
public function get_xml() { SH_Http::sendXml("<results><record><name>Pieter Claerhout</name><email>pieter@shpartners.com</email></record></results>"); }
<?php // Includes require_once dirname(__FILE__) . '/includes/shp_http.php'; // Redirect SH_Http::redirect('demo/');