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

WBOY
Release: 2016-06-13 11:50:45
Original
776 people have browsed it

求大神帮忙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 />
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template