Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print to paper selected data

Tags:

php

mysql

I've a database (image1) and using PHPMaker i created the graphic interface (image2). What i want is to add a button at the bottom of the page that will print the selected data from the selected fields (image3).

Can anyone tell me how to do that?
Do i have to use php code or a javascript?

enter image description here enter image description here enter image description here

like image 457
user1755958 Avatar asked Feb 23 '26 23:02

user1755958


1 Answers

Just add a print link by echoing the following to create a "Print" link on the page

echo "<a href='#' onclick='javascript:window.print();'>Print Page</a>";

Button click will make the browser present the user with the default print dialog.

like image 116
Anirudh Ramanathan Avatar answered Feb 25 '26 12:02

Anirudh Ramanathan