Solved

Print a form to Printer

Posted on 2007-11-20
3
250 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now