CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Opening a window

 



Gardner
Deleted

Jan 31, 2001, 8:00 PM

Post #1 of 4 (167 views)
Opening a window Can't Post

I'm trying to spawn a new browser window, but don't know the perl command. I'm checking a form for required fields, and if the necessary info isn't there, I want a new window to open where I can instruct the user which fields they missed and leave the filled in form in the main window. How do I spawn a new window and direct print statements to it?

Thanks



zanardi
journeyman

Jan 31, 2001, 9:02 PM

Post #2 of 4 (166 views)
Re: Opening a window [In reply to] Can't Post

it would probably be part javascript, the part to open a new window, it would be easy from there, just pass the URL something like

http://yoursite.com/script.cgi?missedfeilds=name,password,whatever

then your code might look something like this

$missedfeilds = param('missedfeilds');
@feildsmissed = split(/,/,$missedfeilds);

print "Sorry but you did not fill out all the feilds", join("< br>",@feildsmissed), "< br>Please try agian";

that is just an example, I dont know if it'd work. It's kinda late and Im losing sleep :)

My BBS


cir
Novice

Feb 14, 2001, 11:45 AM

Post #3 of 4 (144 views)
Re: Opening a window [In reply to] Can't Post

Perl cannot control what the browser does. If you want your script to open in a new window just do this:
<form ... target=_blank>
Note that no matter the outcome, the script opens in a new window.

http://


ebelaski
Deleted

Feb 14, 2001, 1:50 PM

Post #4 of 4 (140 views)
Re: Opening a window [In reply to] Can't Post

  I use perl to check if the parameters are defined,
if not then print message else display page....


if (!$VAR1 || !$VAR2) {
html_init(); #PAGE HEADER
print "
<h4>SORRY! </h4>";
print "<h5>VAR 1or VAR2 was not entered.</h5>
<b>Please use the back button on your browser to return to the form.</br>";
empty_fields(); #PAGE FOOTER
}
else { .... display next page...}



 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives