2016年7月21日 星期四

[PHP] How to redirect web page in PHP,Javascript,HTML

Redirect web page in HTML


befor </head>

<meta http-equiv="refresh" content="0;url=http://www.google.com" />


“content=0” means after 0 second, web will redirect to http://www.google.com


Redirect web page in Javascript


In HTML file,you should write to 

<script>document.location.href="http://www.google.com";</script>


Redirect web page in PHP


<?php
    header('Location: http://www.google.com');
    exit;
?>

沒有留言:

張貼留言