页面跳转
void Core_HttpIO::redirect( string $url [, integer $code = integer 302 ] )
参数列表
参数 类型 描述 默认值 $url
string
Redirect location $code
integer
Status code: 301, 302, etc integer 302
void
public static function redirect($url, $code = 302)
{
if (strpos($url, '://') === true)
{
// Make the URI into a URL
$url = Core::url($url);
}
// Set the response status
HttpIO::$status = $code;
// Set the location header
HttpIO::$headers['Location'] = $url;
// Send headers
HttpIO::send_headers();
// Stop execution
exit();
}