Skip to content

Instantly share code, notes, and snippets.

@sople1
Created December 10, 2014 01:13
Show Gist options
  • Select an option

  • Save sople1/ff8a5b05515d12100f42 to your computer and use it in GitHub Desktop.

Select an option

Save sople1/ff8a5b05515d12100f42 to your computer and use it in GitHub Desktop.
<?php
// 메타태그를 이용한 URL 이동
// header("location:URL") 을 대체
function goto_url($url)
{
$url = str_replace("&amp;", "&", $url);
//echo "<script> location.replace('$url'); </script>";
if (!headers_sent())
header('Location: '.$url);
else {
echo '<script>';
echo 'location.replace("'.$url.'");';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '</noscript>';
}
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment