470,848 Members | 1,447 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

how to open new (printer-friendly) window

Hi all

I have a php script that presents a rather simple form. After the user
filled in parameters and presses <submit>, the results from a postgres
database search follows on the page.

Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.

I guess it could be done, but how?

Grateful for any help!
Jul 17 '05 #1
4 3576
Gandalf wrote:
Hi all

I have a php script that presents a rather simple form. After the user
filled in parameters and presses <submit>, the results from a postgres
database search follows on the page.

Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.

I guess it could be done, but how?


Well, imho you should use CSS for this part...

Use "media" and include 2 stylesheets... one for the screen
(media="screen") and one for the print (media="print")

http://www.w3.org/TR/REC-CSS2/media.html

Regards,
johan

Jul 17 '05 #2
Gandalf wrote:

[snip]
Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.


I guess the easiest solution to this problem would be to use an
alternative stylesheet which removes all the formatting. Linking this to
your document with the following statement would result in nice prints
with most browsers:

<link rel="stylesheet" type="text/css" href="print.css" media="print">

I know this isn't excactly the solution you asked for, but i recommend
you give it a thought.

--
Tormod Fjeldskår
to****@fritidsproblemer.no
http://tormod.fritidsproblemer.no/
Jul 17 '05 #3
Tormod Fjeldskår wrote:
Please check your date settings... or are you from the future? ;)

Regards,
Johan

Jul 17 '05 #4
Johan Holst Nielsen wrote:
Please check your date settings... or are you from the future? ;)


I'm terribly sorry! Did some time-related php-scripts and forgot to
return to the present ;)

--
Tormod Fjeldskår
to****@fritidsproblemer.no
http://tormod.fritidsproblemer.no/
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ben Smeets | last post: by
1 post views Thread by Ed Brandmark | last post: by
3 posts views Thread by ACaunter | last post: by
1 post views Thread by Alessandro | last post: by
6 posts views Thread by slacker | last post: by
1 post views Thread by sathyanrockie | last post: by
19 posts views Thread by Sonnich | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.