Click here to Skip to main content
15,741,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My code :

					 $this->session->set_flashdata('Smessage','<span class="label label-info">Your request has been sent!</span>');
					echo "Mailer Error: " . $mail->ErrorInfo;
					$this->session->set_flashdata('Fmessage','<span class="label label-info">Message could not sent.Please contact Administrator.!</span>');

After sending mail from controller, if mail sent successfully i need to redirect user to home page

but the problem i'm facing is i got redirected to view(home) but the url is not changing it remains unchanged.. i want both redirection and url change...
Updated 24-Oct-13 3:43am
Timberbird 24-Oct-13 10:27am    
Unchanged URL is usually a result of server redirects, but since it's unclear... Have you checked server response and next browser request - for example, with Fiddler2 tool? What does it show? Does this issue exist in all browsers? The problem can be reproduced locally on the server itself?
Ramkumar K 25-Oct-13 2:59am    
Yes,The problem exists on all browsers..actually i'm trying to redirect to a page(application/views/home.php) from the controller under the method "register". After redirecting the url is looks like "". preferred url is "". how to remove the method name 'mail' from the url ?
Timberbird 25-Oct-13 4:13am    
Actually I'm not familiar with PHP and MVC pattern implementation there. I would suggest looking here - it proposes to include JavaScript (which will work in all cases) and also mentions something about controllers and output
Ramkumar K 25-Oct-13 6:32am    
Thanks Timberbird . It is not working..Your Intent to help was great.. thanks again :)

1 solution

In codeigniter use redirect instead of header.


For example in your case :


Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900