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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This form doesn't work. Am i missing something?

Status
Not open for further replies.

WayneC

IS-IT--Management
Jun 22, 2001
6
GB
Can antone help? I can't get this form to work.
Is there something obvious that is missing or
not right.
----------------------

# Use the cgi unit
use cgi;

# Get the values from the form
$form = new CGI;



$subject="MOT Booking";
$tome="mot\@station-garage.net";
$fromme="Customer request";
$server="smtp.station-garage.net";



$server="smtp.station-garage.net";
$make=$form->param('make');
$model=$form->param('model');
$regnumber=$form->param('regnumber');
$fuel=$form->param('fuel');
$lastname=$form->param('lastname');
$firstname=$form->param('firstname');
$address1=$form->param('address1');
$address2=$form->param('address2');
$city=$form->param('city');
$county=$form->param('county');
$postcode=$form->param('postcode');
$month=$form->param('month');
$date=$form->param('date');
$year=$form->param('year');
$time=$form->param('time');
$std=$form->param('std');
$number=$form->param('number');
$email=$form->param('email');


$lt='<';
$gt='>';


# Save the message into a text file
open (messtxt,&quot;>message.txt&quot;);

print messtxt ($make, &quot;\n&quot;);

print messtxt ($model, &quot;\n&quot;);

print messtxt ($regnumber, &quot;\n&quot;);

print messtxt ($fuel, &quot;\n&quot;);

print messtxt ($lastname, &quot;\n&quot;);

print messtxt ($firstname, &quot;\n&quot;);

print messtxt ($address1, &quot;\n&quot;);

print messtxt ($address2, &quot;\n&quot;);

print messtxt ($city, &quot;\n&quot;);

print messtxt ($county, &quot;\n&quot;);

print messtxt ($postcode, &quot;\n&quot;);

print messtxt ($month, &quot;\n&quot;);

print messtxt ($date, &quot;\n&quot;);

print messtxt ($year, &quot;\n&quot;);

print messtxt ($time, &quot;\n&quot;);

print messtxt ($std, &quot;\n&quot;);

print messtxt ($number, &quot;\n&quot;);

print messtxt ($email, &quot;\n&quot;);

close messtxt;

# Build the Blat command line and execute it

$blat=&quot;blat.exe message.txt -s \&quot;$subject\&quot; -t \&quot;$tome\&quot; -f \&quot;$fromme\&quot; -server $server\&quot; &quot;;

system($blat);

print &quot;Location: print &quot;Location: print &quot;Location:
 
Try the following code changes:
Code:
use CGI qw(:all);
open (MESSTXT,...)
print MESSTXT ...
close MESSTXT
In order to make debugging a whole lot easier, you can have compile errors sent to your browser using:
Code:
use CGI qw(:all);
use CGI::Carp qw(fatalsToBrowser);
Hope some of this helps to debug your code :) Neil
 
In particular, I think that you must address the CGI module in upper case. Your 'use' statement is probably failing becuase it is looking for a module that does not exist. You might benefit from takeing a look at faq452-653. It addresses some of the basics of doing CGI stuff.

HTH If you are new to Tek-Tips, please use descriptive titles, check the FAQs,
and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top