Re: RE: function help redirect help

From: Date: Mon, 27 Oct 2003 19:20:48 +0000
Subject: Re: RE: function help redirect help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-167777@lists.php.net to get a copy of this message
--- Frank Tudor <frank_tudor@yahoo.com> wrote: > function payment() > { > global $payment; > if ($payment == '0'); > header ('Location: > http://ftudor/test/test_page.html'); > } > > elseif ($payment == '1') > { > header ('Location: > http://ftudor/test/test_page2.html'); > } Your code looks cleaner, so now isn't the error very obvious? It seems to me that you intended your first conditional statement to send the Location header when true. Therefore, you did not mean to put a semicolon there but rather a curly brace. This is why your function ends prematurely (assuming you did not intend for it to end there), and then you have an elseif statement dangling around with no corresponding if. Chris ===== My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp

« previous php.general (#167777) next »