开发者

How to open a PHP/form results page in a new window?

开发者 https://www.devze.com 2023-02-07 18:11 出处:网络
I have a form: <form action=\"bar.php\"> <input type=\"hidden\" name=\"foo\" value=\"<?php SOME_STUFF(); ?>\" />

I have a form:

<form action="bar.php">
  <input type="hidden" name="foo" value="<?php SOME_STUFF(); ?>" />
  <input type="submit" />
</form>

which acts on a PHP script that generates a PDF from the form开发者_StackOverflow社区 contents:

/* bar.php */
<?php
  $html = $_POST['foo'];
  $pdf->$writeHTML($html);
  $pdf->Output('bar.pdf');
?>

And my client would like this to open in a new window. I know HTML won't validate a target attribute for a form, so must I use JavaScript? And, where?


Try to insert target="_blank" into form tag

and read this http://www.tufat.com/script19.htm about output to pdf

0

精彩评论

暂无评论...
验证码 换一张
取 消