Solved

Print a form to Printer

Posted on 2007-11-20
3
285 Views
Last Modified: 2008-02-01
Hi expert
I have a page, in this page i have some information and a form with name "forprint"
Now i want to print only this form "forprint" to my Printer

So how can i do with PHP ?
Thanks very much.
0
Comment
Question by:fuzzyifs
3 Comments
 
LVL 21

Accepted Solution

by:
nizsmo earned 250 total points
ID: 20318822
you don't do this with PHP, you have to create a page just with the form, say printForm.html and then put ONLY the form on the page. Linke ti printForm.html to your normal form page, have a link something like "print form" which links to printForm.html. This way the visitors can print your form by pressing the Print to print out printForm.html.

Hope this helps. This is unrelated to PHP as PHP is a serverside language, and printing is clientside.
0
 
LVL 6

Assisted Solution

by:den4b
den4b earned 250 total points
ID: 20318827
In your PHP page, create a link like "page.php?printform=1" (as a popup perhaps).

Then, in the code, check if "printform" variable is set, then echo/output ONLY the form data (which you want to print), and execute javascript command "window.print()". After printing you can automatically close the window with "window.close()".
0
 

Author Comment

by:fuzzyifs
ID: 20318855
Thanks to all.
Thanks den4b, i will try with your solution
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question