提交 php [duplicate1] 后重定向


Redirect After Submit php [duplicate1]

这是我的代码:

<input type="submit" name="send" class="do__order" value="order" > 
现在,我想在提交

表单数据后将提交的内容重定向到我选择的任何页面,我该怎么做?

将以下行添加到脚本中:

header('Location: http://www.example.com/');

您可以在进行检查的页面上尝试类似的东西。假设这是check.php

if(isset($_POST['send'])){
   header('Location: somewhere.php');
}

并且您还需要在form标签中添加一个method属性,在这种情况下,它将是 post ,因此method="post"action将是action="check.php" .