hi im creating a form on a site... and have almost completed it now...
the form process is working.. i.e. once filled out and submitted the form is sent and recieved in my inbox etc but the actual data in the form fields is not present...
so all i recieve is
Email:
Name:
etc none of the actual inputed data... can some one please tell me wat to add to print the inputted data... thank ypu code to follow...
form on the site is
code in the perl file is
thanks to all that can help!
the form process is working.. i.e. once filled out and submitted the form is sent and recieved in my inbox etc but the actual data in the form fields is not present...
so all i recieve is
Email:
Name:
etc none of the actual inputed data... can some one please tell me wat to add to print the inputted data... thank ypu code to follow...
form on the site is
| Code: |
| <form method="POST" action="/cgi-bin/contact.pl">
<div align="left"><strong>Fields marked (*) are required </strong></div> <p align="left"><strong>Email:* </strong><br> <input type="text" name="EmailFrom"> <p align="left"><strong>Contact Name:</strong><br> <input type="text" name="ContactName"> <p align="left"><strong>Telephone:</strong><br> <input type="text" name="Telephone"> <p align="left"><strong>Job Title:</strong><br> <input type="text" name="JobTitle"> <p align="left"><strong>Web Address:</strong><br> <input type="text" name="WebAddress"> <p align="left"><strong>Country:</strong><br> <input type="text" name="Country"> <p align="left"><strong>Description of Requirements:</strong><br> <textarea name="DescriptionofRequirements"></textarea> <p align="left"> <input type="reset" name="Reset" value="Reset"> <input type="submit" name="submit" value="Submit"> </form> |
code in the perl file is
| Code: |
| #!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard); print "Content-type: text/html \n\n"; # get posted data into local variables $input = new CGI; $EmailFrom = $input->param('EmailFrom'); $EmailTo = "djhicks\@djhicks.co.uk"; $Subject = "Enquiry Form"; $wdwd = $input->param('wdwd'); # validation $validationOK=true; if ($EmailFrom eq '') {$validationOK=false;} if ($validationOK eq false) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } # prepare email body text $Body .= "Contact Name: "; $Body .= "$ContactName"; $Body .= "\n"; $Body .= "Telephone: "; $Body .= "$Telephone"; $Body .= "\n"; $Body .= "Job Title: "; $Body .= "$JobTitle"; $Body .= "\n"; $Body .= "Web Address: "; $Body .= "$WebAddress"; $Body .= "\n"; $Body .= "Country: "; $Body .= "$Country"; $Body .= "\n"; $Body .= "Description of Requirements: "; $Body .= "$DescriptionofRequirements"; $Body .= "\n"; # send email $mailprog = '/usr/sbin/sendmail -t'; open(MAIL,"|$mailprog"); print MAIL "To: $EmailTo\n"; print MAIL "From: $EmailFrom\n"; print MAIL "Subject: $Subject\n\n"; print MAIL $Body; close(MAIL); # redirect to success page print "<meta http-equiv=\"refresh\" content=\"0;URL=success.html\">"; |
thanks to all that can help!
