Web Programming Language/PHP
PHP) 다른 페이지로 리다이렉션하기
manchesterandthecity
2020. 10. 27. 03:55
PHP에서 페이지 전환(리다이렉션)을 하고 싶을 때 사용할 수 있는 4가지 방법
1. 자바스크립트 Location.href 이용
echo "<script>location.href='URL 또는 경로'</script>";
2. 자바스크립트 Location.replace 이용
echo "<script>location.replace('URL 또는 경로')</script>";
3. Header 이용
header("location: URL 또는 경로");
4. 메타태그 이용
echo "<meta http-equiv='refresh' content='시간' url='URL 또는 경로'";
출처 :