Submit form on differant domains

Hi

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

the form is in

localhost/cgi-bin/myform.pl

the recivinng script is at

localhost:8080/cgi-bin/Getform.pl

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/Getform.pl" method=post target="_blank">

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

Open in new window


Getform.pl
#!/usr/local/bin/perl
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">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>MyForm</title>
  </head>
  <body>
  <h1>Form Values</h1>
HTML

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

  </body>
</html>


HTML

Open in new window

LVL 1
trevor1940Asked:
Who is Participating?
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.

whosbetterthanmeCommented:
Is the webserver that's serving the Getform.pl script configured to run .pl files as scripts? Is it IIS, Apache??
0
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
0
whosbetterthanmeCommented:
Does this script work if it's in the same directory where the other script is?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

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

What are the permission settings on the script?
0
trevor1940Author Commented:
Yes it executes permission are 755
0
FishMongerCommented:
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?
0
whosbetterthanmeCommented:
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?

#!/usr/local/bin/perl
use CGI ':standard';
print header();

print "Hello World!";
0
trevor1940Author Commented:
Hi

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 http://www.microhowto.info/howto/connect_to_a_postgresql_database_using_perl_dbi.html 

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
0
FishMongerCommented:
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.
0

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
0
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
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.