Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Print a form to Printer

Posted on 2007-11-20
3
Medium Priority
?
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 21

Accepted Solution

by:
nizsmo earned 750 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 750 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

660 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