What you say is possible but:

a) Where is created the file? PHP is a server side scripting language. All its actions are performed in the server context and then are sent as a block to the client that requested the action.

b) To print something in a button you have two options: either you use javascript to perform the printing operation, and in that case its a javascript issue in the client side of a client, or you send the printing request to the server, which will be a server side issue, performed by the server (in PHP or any other scripting language or code installed to that effect). In this case, you could print indeed, but the printing computer would be the server itself.

I think that you are looking for something like this:

<a href='javascript:void(0);' onclick='document.print();'>Print</a>

If you need to hide stuff before printing, then you will need to make a javascript function that handles that matter, prints, and after that restores the visibility of the hidden.

Cheers,
Luis Ferro
Teladigital.Net




Bobo Wieland wrote:

Hi!

I'm sorry if this is OT but I really need an answer to this question and I
can't find it anywhere...

I have a link on a page that basicly should work as a print-button. When you
click it, it should print some of the information that is currently
displayed and ad a header and footer of some sort.

The only way i know of doing this is using CSS and showing/hiding layers,
but it would be much easier if I could generate a file of some sort that
will be sent to the printer...

Is there a way to do this sort of thing with php, or could you guys please
help pointing me to some information about this...?

thanks!


:: bobo ::




---
[This E-mail scanned for viruses by Declude Virus]


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to