Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Perl output to new browser window?

by Anonymous Monk
on May 02, 2003 at 20:14 UTC ( #255150=note: print w/replies, xml ) Need Help??

in reply to Perl output to new browser window?

Ok thanks for your comments.

But I am now very confused I found the below code @

Which runs a perl script opening a pop window?
So could you clear up my confusion please?
Can I use or not?

#!/usr/bin/perl #file: use CGI qw/:standard/; print header, start_html('Popup Window'); if (!param) { print h1("Ask your Question"), start_form(-target=>'answer'), "What's your name? ",textfield('name'), p(), "What's the combination?", checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','moe']), p(), "What's your favorite color? ", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']), p(), submit, end_form; } else { print h1("And the Answer is..."), "Your name is ",em(param(name)), p(), "The keywords are: ", em(join(", ",param('words'))), p(), "Your favorite color is ",em(param('color')); } print end_html;

Replies are listed 'Best First'.
Re: Re: Perl output to new browser window?
by pfaut (Priest) on May 02, 2003 at 22:10 UTC

    The key line there is start_form(-target=>'answer'). The 'target' attribute tells the browser which window to display the response in. If a window with the specified name doesn't exist, a new window will be created.

    90% of every Perl application is already written.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://255150]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2021-04-21 03:14 GMT
Find Nodes?
    Voting Booth?

    No recent polls found