All pastes #471650 Raw Edit

liquidengineer

public php v1 · immutable
·published 2007-05-05 01:17 UTC
rendered paste body
/** * This function handles redirecting a user to a given location. * It constructs the $target's absolute path to avoid potential problems. * NOTE: This must be run before any output, or an error will result. */function redirectTo($target){    $host  = $_SERVER['HTTP_HOST'];    $uri   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');    header("Location: http://$host$uri/$target");}