页面重定向问题 - 页面被重定向但网址没有变化 [英] Page Redirect problem - Page is redirected but url is not changing

查看:138
本文介绍了页面重定向问题 - 页面被重定向但网址没有变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码:



 if($ mail-> Send())

{
$ this-> session-> set_flashdata(' Smessage'' < span class =label label-info>您的请求已发送!< / span>');
header( location:$ baseurl / index.php);

}
else
{
echo 邮件程序错误:。 $ MAIL-> ERRORINFO;
$ this-> session-> set_flashdata(' Fmessage'' < span class =label label-info>无法发送消息。请联系管理员。!< / span> );
header( location:$ baseurl / index.php);
}







从控制器发送邮件后,如果邮件发送成功,我需要重定向用户到主页



但是我面临的问题是我被重定向到查看(主页)但是网址没有改变它保持不变..我想要两个重定向和网址更改...

解决方案

mail->发送())

{


< blockquote> this-> session-> set_flashdata(' Smessage'' < span class =label label-info>您的请求已发送!< / span>');
header( location:


baseurl / index.php );

}
else
{
echo 邮件程序错误:


My code :

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




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...

解决方案

mail->Send()) {


this->session->set_flashdata('Smessage','<span class="label label-info">Your request has been sent!</span>'); header("location:


baseurl/index.php"); } else { echo "Mailer Error: " .


这篇关于页面重定向问题 - 页面被重定向但网址没有变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆