Welcome Guest, Not a member yet? Register   Sign In
email header error
#1

[eluser]Corbee[/eluser]
Hi,

I'm trying to redirect to the dashboard once a mail was sent, but I kept ending up with the ff error:
Code:
if ($this->email->send())
        {
            $this->session->set_flashdata('message','Your mail was send, please check your email');
            redirect('memboards','refresh');    
        }        
        else
        {
            $this->session->set_flashdata('message','Encountered an error sending your mail, please try again');
            redirect('memboards','refresh');
        }

Where did I go wrong?
Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\ampp\htdocs\insurance1\system\libraries\Exceptions.php:166)

Filename: libraries/Session.php

Line Number: 662
#2

[eluser]bretticus[/eluser]
You cannot set a cookie (session) nor can you set a header (redirect) when anything has been written beforehand. Your warning indicates that there is an error message written to buffer from some point before you call your session and redirects. Comment out your session/redirect code and deal with the previous error.
#3

[eluser]Corbee[/eluser]
Oh, I see, thanks




Theme © iAndrew 2016 - Forum software by © MyBB