RE: [PHP] Help with IF ELSE
| From: | David Stoltz | Date: | Fri, 05 Dec 2008 11:42:45 +0000 |
| Subject: | RE: [PHP] Help with IF ELSE | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284155@lists.php.net to get a copy of this message | ||
I turned on error reporting (ALL) as you suggested. Nothing is being
sent to the browser....still doesn't work if the recordset isn't empty.
I'm wondering, is there any other way to do a redirect in PHP?
Thanks
-----Original Message-----
From: richard.heyes@gmail.com [mailto:richard.heyes@gmail.com] On Behalf
Of Richard Heyes
Sent: Thursday, December 04, 2008 3:17 PM
To: David Stoltz
Cc: php-general@lists.php.net
Subject: Re: [PHP] Help with IF ELSE
> I'm new to PHP - I'm trying to figure out what is wrong with a simple
IF
> ELSE block I have...if the recordset $rs is empty (login fails), the
1st
> part of the block works, and redirects the user to default.php - but
if
> the login works, and $rs is not empty, the 2nd "else" part does not
> work, and does not redirect to menu.php - I just get a blank white
> screen on the login.php page (where this code is)....
You could try setting error_reporting() to full before you do
anything, it may help, and it's always prudent to use it that way:
<?php
error_reporting(E_ALL);
?>
Additionally, redirects fail when you've sent output to the browser,
even if its just whitespace. Your code looks OK, but check for it. The
error reporting thang may help you with that.
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 29th)