gpt4 book ai didi

javascript - HTML 表单 POST 到直接打印页面

转载 作者:行者123 更新时间:2023-11-28 06:29:00 24 4
gpt4 key购买 nike

我有页面 VIEW-SALE.PHP在此页面上,我有一个提交按钮表单,用于查看打印格式的发票,其中包含代码:

     <span style='display:inline-block'>
<form name='print' id='print' action='print-invoice.php'
target='_blank' method='post'>
<input type='hidden' name='invoice' value='$invoice'>
<input class='submit-all' type='submit'
value='Print the invoice'
onClick='window.print();return false'></form></span>

代码必须只打开页面 PRINT-INVOICE.PHP 并打印它,但是当我单击它时它显示打印对话框但当前页面我是 VIEW-SALE.PHP 所以它不显示 PRINT-INVOICE。 PHP

如何实现?

最佳答案

不发布只是发布数据你可能需要一个标题重定向重定向是 php 代码

header("Location: blabla")

我找到了这个你可能会发现它有帮助 redirect after submit

关于javascript - HTML 表单 POST 到直接打印页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35104160/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com