Talonsrest
08-24-2006, 11:19 PM
I am building a form that allows the user to select several options they would like when we order them a server and then the form will take the information and send it to our ticketing system. I have a small test form built and a perl script to send the information. Both pieces work individually. If I take the action attribute out of the form tag and submit the form, I can see the form is submitting the correct information. I can then copy and paste it as the arguments to the command line for a perl script and that sends the mail beautifully.
The problem is that when I click send to call the script from the page, the values are not passed to the script. I created a test script to just print any arguments to a file and it just creates an empty file.
I've tried single and double quotes on the action attribute value. I've tried putting the script in the same directory as the page file.
Any help would be appreciated. This is being tested on a Windows XP system with IIS installed.
The code for the page and the script are as follows.
Perl Script
#! /usr/local/bin/perl -w
use Net::SMTP;
use CGI qw(:standard);
$subject = "Subject: New Server Request";
$newline = "\n";
$requester = param('name'). " would like to request a server\n";
$ramsize = "Ram = ". param('ram');
$drivesize = "\nHard Drive =". param('harddrive');
@message = ($subject, $newline, $requester, $ramsize, $drivesize);
$smtp = Net::SMTP->new("xxxxx.xxxx.xxxx.com");
$smtp->mail("username\@xxxx.xxxx.com");
$smtp->to("ticketingsystem\@xxxx.xxxx.com");
$smtp->data(@message);
$smtp->quit;
Web Page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
<html>
<head><title>Test Server Form</title></head>
<body>
<form action ="/cgi-bin/mailer.pl" method="get" >
<p>
<h4>Name:</h4>
<input name="name" class="required" />
<h4>Memory</h4>
</p>
<p>
<SELECT name="ram" class="required">
<option selected value=128>128 Meg</option>
<option value=256>256 Meg</option>
<option value=512>512 Meg</option>
<option value=1024>1 Gig</option>
</select>
</p>
<p>
Hard Drive:
<select name="harddrive" class="required">
<option selected value=18>18 Gig</option>
<option value=40>40 Gig</option>
<option value=128>80 Gig</option>
<option value=128>120 Gig</option>
</select>
</p>
<p>
<input type="submit" value="Send" />
</p>
</form>
</body>
</html>
The problem is that when I click send to call the script from the page, the values are not passed to the script. I created a test script to just print any arguments to a file and it just creates an empty file.
I've tried single and double quotes on the action attribute value. I've tried putting the script in the same directory as the page file.
Any help would be appreciated. This is being tested on a Windows XP system with IIS installed.
The code for the page and the script are as follows.
Perl Script
#! /usr/local/bin/perl -w
use Net::SMTP;
use CGI qw(:standard);
$subject = "Subject: New Server Request";
$newline = "\n";
$requester = param('name'). " would like to request a server\n";
$ramsize = "Ram = ". param('ram');
$drivesize = "\nHard Drive =". param('harddrive');
@message = ($subject, $newline, $requester, $ramsize, $drivesize);
$smtp = Net::SMTP->new("xxxxx.xxxx.xxxx.com");
$smtp->mail("username\@xxxx.xxxx.com");
$smtp->to("ticketingsystem\@xxxx.xxxx.com");
$smtp->data(@message);
$smtp->quit;
Web Page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
<html>
<head><title>Test Server Form</title></head>
<body>
<form action ="/cgi-bin/mailer.pl" method="get" >
<p>
<h4>Name:</h4>
<input name="name" class="required" />
<h4>Memory</h4>
</p>
<p>
<SELECT name="ram" class="required">
<option selected value=128>128 Meg</option>
<option value=256>256 Meg</option>
<option value=512>512 Meg</option>
<option value=1024>1 Gig</option>
</select>
</p>
<p>
Hard Drive:
<select name="harddrive" class="required">
<option selected value=18>18 Gig</option>
<option value=40>40 Gig</option>
<option value=128>80 Gig</option>
<option value=128>120 Gig</option>
</select>
</p>
<p>
<input type="submit" value="Send" />
</p>
</form>
</body>
</html>