Date: Mon, 29 Oct 2012 09:36:53 +0100 From: =?ISO-8859-1?Q?Bo_Wis=E9n?= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.php Subject: Header and if statement Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 121028-1, 2012-10-28), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: news.synserver.de Message-ID: <508e4026$1@news.synserver.de> X-Trace: news.synserver.de 1351499814 81.237.193.152 (29 Oct 2012 09:36:54 +0200) Organization: synergetic AG Lines: 14 X-Complaints-To: abuse@synergetic.ag X-SynServer-News: news.synserver.de Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!news1.dtag.de!news.synserver.de!not-for-mail Xref: csiph.com comp.lang.php:7381 Hi, I want to redirect to one page if $typ=0 and another page if $typ=1. I'm trying this code: if ($typ == 0) { header ("Location:page1.php"); } else { header ("Location:page2.php"); } But undepending on the value of $typ it redirects to page1.php. Why? / Bo