Loading

[PHP] 跳转以及回到原来的地址

回到原来的地址:

1.PHP(PHP代码)

Header('Location:'.$_SERVER["HTTP_REFERER"]);

 

2.JavaScript(相当于后退按钮,-1代表后退一步)(HTML代码)

<a href="javascript:history.back(-1)">Back</a>

 

跳转地址:

1.Header函数 (PHP代码)

header("Location: http://www.google.com");

 

2.JavaScript (JavaScript代码)

window.location.href=‘www.baidu.com’
location.replace("www.baidu.com")

 

3.HTML超链接(HTML代码)

<a href="www.google.com">Google</a>

 

4.HTML中META头内容(其中5表示5秒后跳转)(HTML代码)

<meta http-equiv="refresh" content="5" url=http://www.baidu.com/"> 

 

posted @ 2013-07-01 16:46  魍魉_198x  阅读(983)  评论(0编辑  收藏  举报