darkfreaks Posted February 10, 2008 Share Posted February 10, 2008 ok how do i modify the following statement so it does not terminate the script and give mea headers already sent error? die and exit do not work <?php if(empty($variable)){ exit;} if(empty($variable)){ die;} ?> Quote Link to comment Share on other sites More sharing options...
mem0ri Posted February 10, 2008 Share Posted February 10, 2008 You're going to have to give us more information than just those two lines of very simple code... ...a headers-already-sent error means that you've already established header-elements on the page and therefore cannot modify them further. You will need to change the location of your code-block to occur before headers are sent. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 10, 2008 Author Share Posted February 10, 2008 is this code right? <?php if ($username === false) { $this->register_error = REGISTER_USERNAME_ERROR; return false; }?> i just want it so if they dont enter anything to error? Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 10, 2008 Share Posted February 10, 2008 try <?php if(empty($username)){ $this->register_error = REGISTER_USERNAME_ERROR; return false; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.