简体   繁体   中英

command to print a page in php without prompt

I am using following code in php, html and javascript to print a html page and redirect to another page. It displays a prompt. I need that page to be printed without showing printing prompt/screen and automatically redirect to new php page.

     <input type="button" value="Print & Do New Transaction" class="button" id="payout_print"  onclick="window.print();window.location.href='transaction/admin/new_transaction'">

I have gogled it, but didn't get any useful answer that I am looking for. How to do this?

For redirect a page you need to do:

<?
header("Location: destination_page.php");
exit;
?>

Remember to don't print any html code before this code because you'll get an error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM