Re: RE: function help redirect help
| From: | Chris Shiflett | Date: | Mon, 27 Oct 2003 19:10:36 +0000 |
| Subject: | Re: RE: function help redirect help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167774@lists.php.net to get a copy of this message | ||
--- Frank Tudor <frank_tudor@yahoo.com> wrote:
> I am getting a elseif parse error.
Let me clean up your code a bit, and hopefully the error will stand out.
function payment()
{
global $payment;
if ($payment == '0');
header ('Location: http://example.org/test_page.html');
}
global $payment;
elseif ($payment == '1')
{
header ('Location: http://example.org/test_page2.html');
}
Can you see the problem(s) now? Never underestimate the benefits of writing
clean code. :-)
Chris
=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp