数据传递到另一页


Data Pass to another page

我有一个html表单来选择报告类型,当我选择一个报告并按下提交按钮时,我可以捕捉到传递值我从数据库中过滤数据,然后我必须将过滤后的数据传递到另一个页面以打印该报告,

那么我怎样才能自动将数据传递到另一个页面呢。(页面应选择_blank)

您可以使用隐藏字段来存储数据。并使用将表单明确提交到另一个页面

 $('form#FormID').submit();

这将帮助您获取下一页的数据。您也可以使用$_SESSION。

php页面中的

<html>
<body>
<form action="other.php" method="post">
   Name: <input type="text" name="name">
   Email: <input type="text" name="email">
<input type="submit">
</form>
</body>
</html> 

其他.php

<html>
<body>
  Hi <?php echo $_POST["name"]; ?>!<br>
  Your mail is <?php echo $_POST["mail"]; ?>.
</body>
</html>