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

WBOY
Release: 2016-06-23 14:00:54
Original
733 people have browsed it

我是新人这几天刚学php,在php方法函数里面怎么跳转到另一个页面。我用的CI框架
比如:控制器login.php里面有个function A()为登陆方法。登陆之后然后跳转到主页。主页控制器为main.php


回复讨论(解决方案)

redirect 方法

在function A()加入
form name="XX" method="post" action="main.php"

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

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

redirect()方法是自己定义吗 为什么我用redirect方法报错找不到这个方法
js脚本可以跳转

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