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;} ?> Link to comment https://forums.phpfreaks.com/topic/90323-code-help/ 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. Link to comment https://forums.phpfreaks.com/topic/90323-code-help/#findComment-463129 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? Link to comment https://forums.phpfreaks.com/topic/90323-code-help/#findComment-463142 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; } ?> Link to comment https://forums.phpfreaks.com/topic/90323-code-help/#findComment-463144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.