Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl script pops up new unwanted Browser window

Status
Not open for further replies.

cosports

Programmer
Dec 16, 2000
9
US
AAAgggg!!!
I cant figure out why this is happening.
I have a cgi script written in perl.
It has a Form that when submitted, populates
a database. After that it crates a "thank you" page.
For no apparent reason it opens a new browser window
for the thank you page instead of refreshing the
form page. How do you keep everything in one
browser window?
Thanks
Eric
 
Do you print "Content-type: text/html\n\n" before anything else in your thank you page? Do you have a target="" in your form?
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
I beleive the answer is yes to the first question.
I'm using cgi_pm: $q->header;

And as for the form I'm not using a specific target,
On submit i call $script_url/insert.

I'm using SWITCH statements with the form:
if newForm then call Sub...
if insert then call Sub...


$script_url/newForm ##This creates the form
$script_url/insert ##This does the insert and prints
"Thank you".
-eric

 
I'm not too familiar with cgi_pm, so your problem is probably in there somewhere. Try just printing your form, ie:

print qq~<form><input><input></form>~;

It shouldn't open a new window by default. I'm sure its the way you are calling cgi_pm functions.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
hmm, i've never had this problem before, it might be an html problem before you submit form. do you have a target in your form tag? can you post your code for the page that calls the script? adam@aauser.com
 
thanks tom and adam.
I had a target specified that should not have been there.
(I don't remember even putting it there :,) )
Once i removed the target the program worked great.
The forums have done it again..
-eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top