开发者

redirect to different page in PHP [duplicate]

This question already has answers here: 开发者_如何学Python Closed 11 years ago.

Possible Duplicate:

PHP page redirect

I have 0 experience with PHP. I was setting up a blog in wordpress which is in PHP.

In a page there are includes. Now I do I redirect users from page to the other.

For example: When users visit pics.php I want to redirect them to Gallery.php


You can redirect the users browser via the header() function:

header( "Location: gallery.php" );

You will need to ensure that no output has been sent before this line (check for echo and print statements, as well as anything that may produce errors or warnings).


See header:

header('Location: http://domain.com/Gallery.php');


Read manual for header.

If the Location header is modified, the browser will make a new request to the specified URL.


header('Location: /Gallery.php');


Just use

header('Location: /pics.php');

or

header('Location: http://www.mydomain.com/header.php');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜