Submit form on differant domains


I'm creating  a geoserver apllication and need to submit my form accross domains

the form is in


the recivinng script is at


on submit a blank window opens and then the save to dialog box appears.

How can i get round this?

sample form
<form action="http:://localhost:8080/cgi-bin/" method=post target="_blank">

<input type ="text" name="myVar1">
<input type ="text" name="myVar2">
<input type ="submit"  value="Submit">

Open in new window
print "Content-type:text/html\n\n";

use CGI;
 my $q = CGI->new;
my $HiddenText = $q->param('HiddenText');

my @Names = $q->param;

print <<HTML;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor,">
  <h1>Form Values</h1>

foreach my $name (@Names)
    print "<p>" . $name . "[ " . $q->param($name) . "]</p>";  
print <<HTML;



Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is the webserver that's serving the script configured to run .pl files as scripts? Is it IIS, Apache??
trevor1940Author Commented:
Webserver / GeoServer (localhost:8080) is Tomcat a cgi folder has been configured & tested to run .pl scripts On my test box, fedora,  I could possibly move all files from the Apache (localhost) server into the tomcat sever (localhost:8080) how ever this may not be possible when the application goes live
Does this script work if it's in the same directory where the other script is?
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

trevor1940Author Commented:
Placing the script in localhost/cgi-bin/ works in it takes the variables from the form & prints them but it needs to sit here localhost:8080/cgi-bin/ because Geoserver uses AJAX to deal  with user interactions
Does the script execute if you call it directly as opposed to via the form submission?

What are the permission settings on the script?
trevor1940Author Commented:
Yes it executes permission are 755
Is Apache and Tomcat using the exact same system path to the cgi-bin directory?

I have almost zero experience with Tomcat, but one thing to check is that the context has "privileged="true" configured, which is needed to execute the scripts.  However, that may not be the problem in your case, since it is executing when called directly but not when called via a form submission.

Have you tried restarting Tomcat to see if that clears up the issue?
You said a "blank (window) page" opens. But is there any HTML code returned at all by viewing the source?

Did you try writing a simple script and calling directly?

use CGI ':standard';
print header();

print "Hello World!";
trevor1940Author Commented:

i've solved this it turns out Tomcat is pointing to the defult instalation of perl that comes with fedora I'm using a newer version of perl.

sys manager is looking into how to reconfiger tomcat so it is pointing to the newer version of perl

it's unclear why this failed accross domains but instaling the DBD modual into the defult perl location cured it.

In answer to your question i created a simple script ran it in a terminal which worked & ran in a browser that failed The script was taken from here 

I delibratly used a incorrect role name an error was raised in the terminal window in the browser nothing it wasn't until we looked in the logs we discovered the error
I'm glad to hear that you've solved the problem, but if simply installing the DBD module solved the problem, then you left out some very important details which would have helped us to help you solve the problem and you mislead us on what was happening.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
trevor1940Author Commented:
I'm aware i didn't mention DBD in origenal post Sorry
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.