0

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

Community
  • 1
  • 1
acadia
  • 2,619
  • 18
  • 55
  • 72

5 Answers5

1

See header:

header('Location: http://domain.com/Gallery.php');
Adam Hopkinson
  • 28,281
  • 7
  • 65
  • 99
  • Voted this up, because the Location header officially requires a full domain path (although relative paths work virtually everywhere). – GolezTrol Aug 29 '11 at 20:14
1

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

George Cummins
  • 28,485
  • 8
  • 71
  • 90
0

Read manual for header.

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

JK.
  • 5,126
  • 1
  • 27
  • 26
0
header('Location: /Gallery.php');
Dejan Marjanović
  • 19,244
  • 7
  • 52
  • 66
0

Just use

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

or

header('Location: http://www.mydomain.com/header.php');
JJ.
  • 5,425
  • 3
  • 26
  • 31