繁体   English   中英

操作后的php页面重定向

[英]php page redirect after operation

我有一个页面(index.php),其中有一个带有子页面(<< 1,2,3,4 >>)的php网格。 在任何页面上的操作都将带您回到index.php。 使用$ _GET ['prd_p']或$ _REQUEST ['prd_p']可提供页码。 我希望用户在操作后留在页面上,这意味着我必须使用重定向。

<form name="frmSearchMe" action="<?php echo $page_name; ?>" method="POST">
<tr>
 <input class='form_button' type='submit' name='btnSubmit' value=' Save ' onclick='return checkerrors();' /></td>
 </tr>
//php codes here
</form>

位置标头可用于重定向人员

header('Location: index.php?stuff=squirrel');

如果要根据用户数据在其中设置值,请确保首先验证它们(例如使用ctype_digit之类的功能)

是的,执行该操作后,您必须重定向回同一页面。

header("location:url&".$_GET['prd_p']);
die();

您应该在重定向语句之后使用die()exit()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM