Heim >Backend-Entwicklung >PHP-Tutorial >求大神帮忙php页面跳转问题

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:00:54785Durchsuche

我是新人这几天刚学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>";}

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

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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn