cgi help

  danielmasters 11:18 23 Jan 08
Locked

Firstly, I'm a total cgi virgin.

I've got a project for university that requires me to use a form to gather data for a shopping order from someone. I then process it in javascript to produce a page telling the person their order details.

I also need to process the form using cgi to email the details to the user. Now this is where I struggle big time.

Check out my script first, no idea if it's even remotely good

###########here's my script!############

#!/usr/local/bin/perl

$mailprog = 'sendmail';
$datecommand = "date";
$time = '$datecommand';
open (MAIL, "|$mailprog -t");

print MAIL "To: $email\n";
print MAIL "From: danielmasters\@hotmail.co.uk\n";
print MAIL "Subject: Order Received\n";
print MAIL "Thankyou for your order, $name $sname";

close (MAIL)

###########here's my script!############



I've uploaded it to my uni server, and when I try to call it from the form I get the following error:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



I've used filezilla to set the file attributes to 755 as I think is right.

I'm really unsure what to do here :/

  Kemistri 19:16 23 Jan 08

It sounds like you're using JS to do what PHP can do better. Only use JS when you need a client-side function that server-side scripting cannot reproduce; otherwise use PHP.

Assuming that you have not been specifically instructed to do it this way (which would be a bit surprising).

  danielmasters 19:37 23 Jan 08

unfortunately it is required that I use cgi and javascript :/

  danielmasters 19:39 23 Jan 08

Also, we're doing PHP this semester. The page that I have built will then be recoded to be php instead of js!

This thread is now locked and can not be replied to.

Surface Pro (2017) vs Surface Pro 4

20 groundbreaking 3D animation techniques

How to mine Bitcoin on Mac