page redirect

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
sarbas
Forum Commoner
Posts: 64
Joined: Thu Jan 04, 2007 5:51 am

page redirect

Post by sarbas »

hai...
i want to redirect two pages in a single php page using if... else....
if(...)
{
...
...example.php

}
else
{
...
example1.php

}
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Image
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

:o
Firstly , I think code is not in proper tags, You need to go through Forum rules. Secondly the question should be in PHP code forum but not in Linux. Anyhow You need to go through PHP header function

Code: Select all

if($yourcondition){
 header('Location:example.php');

}else{
header('Location:example1.php');
}
Note: No echo or print messages above these headers.
Post Reply