重定向到PHP中的不同页面[重复]

问题描述:

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

可能重复: strong>
PHP页面重定向 p> blockquote>

我有 0 PHP经验。 我正在用Word中的wordpress建立一个博客。 p>

在页面中有包含。 现在我将用户从页面重定向到另一个。 p>

例如:当用户访问pics.php时我想将它们重定向到Gallery.php p> div >

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).

Read manual for header.

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

See header:

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

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

Just use

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

or

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