[英]Redirect different pages after form submit, based on URL sequence
I have a form page called form.php which will submit data to send.php with the general form format: 我有一个名为form.php的表单页面,它将以常规表单格式提交数据到send.php :
<form action="send.php" method="post">
I'd like to make it more advanced with redirect function after submission, based on URL sequence. 我想基于URL序列在提交后使用重定向功能使其更高级。
Example plot: 示例图:
If someone submit data from form.php?redirect=home.php , he will be redirected to home.php after submitting data 如果有人从form.php?redirect = home.php提交数据, 则在提交数据后他将被重定向到home.php。
How would I do this? 我该怎么做?
You can include at the end of send.php, a redirection to the value in form.php?redirect=XXXXXX 您可以在send.php的末尾添加一个重定向到form.php?redirect = XXXXXX中的值
something like: 就像是:
<?php
$url=$_GET["redirect"];
header("Location: $url");
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.