본문 바로가기

컴퓨터 사용 팁

HTML Redirect


===========================================
><meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
><meta http-equiv=Refresh content=0;url="http://www.gagadomain.com/board/bbs.php?code=board1">
>
>이런 씩으로 header를 이용한 redirect를 사용하지 않고 redirect를 할 수 있는데
>웹 포럼 강의 읽어보면 meta http-equiv 테그를 이용한 redirect를 하지 말라고 매우 않좋다고 하던데 왜 그렇습니까?
>
>감사합니다~
>즐거운 하루 되세욥~

어떤 포럼에서 그렇게 이야기 하는지요.

저는 특별하게 나쁜 이유를 알수 없겠는데요.

redirect 시키는 방법은

///////////////////////////////////////////////////////////////////////
// 함 수 명 : Redirect
// 입력 필드
// $url : 이동할 URL
// $time : 시간
// 리 턴 값 : 없슴
function Redirect($url,$time=0)
{
?>
<html><head><meta http-equiv="Refresh" content="<?echo $time;?>; URL=<?echo $url;?>"></head>
<body></body></html>
<?
}


///////////////////////////////////////////////////////////////////////
// 함 수 명 : RedirectTarget
// 입력 필드
// $url : 이동할 URL
// $target : 이동할 target
// $param : 전달할 Parameter
// 리 턴 값 : 없슴
function RedirectTarget($url,$target,$param)
{
?>
<html>
<body onLoad="document.form1.submit();">
<form action="<?echo $url;?>" target="<?echo $target;?>" name="form1" method="post">
<? echo $param;?>
</form>
</body>
</html>
<?
}




위와 같이 두가지를 즐겨 사용합니다.

그런데 아래의 방법은 해당 redirect에 대한 target을 줄수 있는 것 말구는 그렇게

크게 다른것이 없는데..

어떤 web forum이지요.

제가 한번 그 글을 읽고 싶습니다.