>  기사  >  백엔드 개발  >  求大神帮忙php页面跳转有关问题

求大神帮忙php页面跳转有关问题

WBOY
WBOY원래의
2016-06-13 11:50:45734검색

求大神帮忙php页面跳转问题
我是新人这几天刚学php,在php方法函数里面怎么跳转到另一个页面。我用的CI框架
比如:控制器login.php里面有个function A()为登陆方法。登陆之后然后跳转到主页。主页控制器为main.php
------解决方案--------------------
在function A()加入
form name="XX" method="post" action="main.php"
------解决方案--------------------

<br />function A()<br />{<br />	redirect('/main');<br />}<br /><br />function A()<br />{<br />	echo "<script>window.location.href='/main';</script>";<br />}<br />

------解决方案--------------------
可以使用js 或者 php
js
window.location.href
php
header("Location:xxx");

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.