Solved

Print a form to Printer

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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 create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

628 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