Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<form action="[b]Destination for CGI script goes here[/b]" method="POST">
<table width="98%" border="0" cellpadding="1" cellspacing="1">
<tr>
<td width="25%">Name</td>
<td width="50%"> <input name="name" type="text" size="65">
</td>
</tr>
<tr>
<td width="25%">Company Name</td>
<td width="50%"> <input name="cname" type="text" size="65">
</td>
</tr>
<tr>
<td width="25%">Telephone</td>
<td width="50%"> <input name="tel" type="text" size="65">
</td>
</tr>
<tr>
<td width="25%">E-mail</td>
<td width="50%"> <input name="email" type="text" size="65">
</td>
</tr>
<tr>
<td width="25%">Message</td>
<td width="50%"> <textarea name="dep" cols="50" rows="10">Type Your Message Here ...</textarea>
</td>
</tr>
<tr>
<td width="25%" height="30"> <div align="right"> <font size="2">
<input type="submit" value="Click to Send" name="B1">
</font></div></td>
<td width="50%" height="30"> <font size="2">
<input type="reset" value="Reset" name="B2">
</font></td>
</tr>
</table>
</form>
#!/usr/bin/perl --
# URL to go to if there is a problem with form input
$ErrorPage = "http://[b]your domain[/b]/fail.htm";
# URL to go to when form has been successfully submitted
$ThankPage = "http:/[b]your domain[/b]/thanks.htm";
# URL to go to if a 'foreign' referer calls the script
$EvilReferer = "http://[b]your domain[/b]/index.htm";
# E-mail address to send intake form to (your address)
# If not using PERL 5, escape the @ thus: \@ instead of @
$YourEmail = '[b]your e-mail address[/b]';
# Script works only on your server(s) - ('URL1','URL2')
@referers = ('http://[b]your domain[/b]/',);
# Location of mail program - check your doc or ask admin
$MailProgram = '/usr/sbin/sendmail -i -t';
# Subject of the e-mail autoreply to the submitter
$Subject = "[b]your company name[/b] Message Received on ";
##### END OF SETTABLE VARIABLES ############################
##### MAIN PROGRAM #########################################
# ___ Do not edit below this line __________________________
&CheckReferingURL;
&ReadParse;
$name = $in{'name'};
$cname = $in{'cname'};
$tel = $in{'tel'};
$dep = $in{'dep'};
$email = $in{'email'};
&CheckEmailAddressFormat;
&CheckFields;
&GetDate;
&SendSubmission;
&SendAutoReply;
print "Location: $ThankPage\n\n";
exit;
# _________________________________________________________
sub SendSubmission {
open (MAIL,"|$MailProgram -t");
print MAIL "To: $email\n";
print MAIL "From: $YourEmail\n";
print MAIL "Subject: $Subject $Date, $Timesent\n";
print MAIL "Dear $name,\n\n";
print MAIL "Thanks for your enquiry, we will respond as soon as possible. \n\n";
print MAIL "Kind Regards\n\n";
print MAIL "[b]your domain[/b]\n";
print MAIL "[b]your company name[/b]\n\n";
print MAIL "Tel: [b]telephone[/b]\n";
print MAIL "Fax: [b]fax[/b] \n";
print MAIL "Email: sales\@[b]your domain[/b] \n";
print MAIL "Website: [b]your domain[/b] \n\n";
print MAIL "-------------------------------------------------------------\n";
print MAIL "COPY OF INTERNET RESPONSE FORM\n\n";
print MAIL "Name: $name\n";
print MAIL "Company: $cname\n";
print MAIL "Telephone: $tel\n";
print MAIL "Interest: $dep\n";
print MAIL "Email: $email\n\n";
print MAIL "****************************************************************************\n";
print MAIL "CONFIDENTIALITY NOTICE\n";
print MAIL "This Email and any files transmitted with it are confidential and may be\n";
print MAIL "privileged. They are intended solely for the use of the individual or\n";
print MAIL "entity to which they are addressed. If you have received this Email in\n";
print MAIL "error you should not copy or use it for any purpose or disclose its contents\n";
print MAIL "to any person. You should deliver the message to the intended addressee. \n";
print MAIL "Unauthorised use or disclosure is prohibited and may be unlawful.\n";
print MAIL "****************************************************************************\n";
close (MAIL);
}
# _________________________________________________________
sub SendAutoReply {
open (MAIL,"|$MailProgram -t");
print MAIL "To: $YourEmail\n";
print MAIL "From: $email\n";
print MAIL "Subject: Customer enquiry from [b]your domain[/b]\n";
print MAIL "To [b]your company name[/b],\n\n";
print MAIL "$name has used the website on $Date, $Timesent, and has input the following information\n\n";
print MAIL "We have agreed to reply to the enquiry as soon as possible\n\n";
print MAIL "-------------------------------------------------------------\n";
print MAIL "Name: $name\n";
print MAIL "Company: $cname\n";
print MAIL "Telephone: $tel\n";
print MAIL "Interest: $dep\n";
print MAIL "Email: $email\n\n";
print MAIL "****************************************************************************\n";
print MAIL "CONFIDENTIALITY NOTICE\n";
print MAIL "This Email and any files transmitted with it are confidential and may be\n";
print MAIL "privileged. They are intended solely for the use of the individual or\n";
print MAIL "entity to which they are addressed. If you have received this Email in\n";
print MAIL "error you should not copy or use it for any purpose or disclose its contents\n";
print MAIL "to any person. You should deliver the message to the intended addressee. \n";
print MAIL "Unauthorised use or disclosure is prohibited and may be unlawful.\n";
print MAIL "****************************************************************************\n";
close (MAIL);
}
# _________________________________________________________
sub GetDate {
@days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
@months = ('01','02','03','04','05','06','07','08','09','10','11','12');
@minutes = ('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17',
'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34',
'35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51',
'52','53','54','55','56','57','58','59');
@seconds = ('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17',
'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34',
'35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51',
'52','53','54','55','56','57','58','59');
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = $year+1900;
$Date = "$days[$wday] $mday/$months[$mon]/$year";
$Timesent = "$hour:$minutes[$min]:$seconds[$sec]";
}
# _________________________________________________________
sub ReadParse { local (*in) = @_ if @_;
local ($i, $key, $val); if ( $ENV{'REQUEST_METHOD'} eq "GET" )
{$in = $ENV{'QUERY_STRING'};}
elsif ($ENV{'REQUEST_METHOD'} eq "POST")
{read(STDIN,$in,$ENV{'CONTENT_LENGTH'});}
else {
$in = ( grep( !/^-/, @ARGV )) [0];
$in =~ s/\\&/&/g; } @in = split(/&/,$in);
foreach $i (0 .. $#in) {
$in[$i] =~ s/\+/ /g;
($key, $val) = split(/=/,$in[$i],2);
$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;
$in{$key} .= "\0" if (defined($in{$key}));
$in{$key} .= $val; } return length($in); }
# _________________________________________________________
sub CheckEmailAddressFormat {
if (index($email, "@") < 1) {&DoEmailError;}
if (index($email, ".") < 1) {&DoEmailError;}
if (index($email, " ") > -1) {&DoEmailError;}
}
sub CheckFields {
if (!$cname || $cname eq ' ') {&DoEmailError;}
if (!$name || $name eq ' ') {&DoEmailError;}
if (!$email || $email eq ' ') {&DoEmailError;}
if (!$tel || $tel eq ' ') {&DoEmailError;}
}
sub DoEmailError {
print "Location: $ErrorPage\n\n";
exit;
}
# _________________________________________________________
sub CheckReferingURL {
if ($ENV{'HTTP_REFERER'}) {
foreach $referer (@referers) {
if ($ENV{'HTTP_REFERER'} =~ /$referer/i) {
$check_referer = '1';
last;
}}}
else {$check_referer = '1';}
if ($check_referer != 1) {
print "Location: $EvilReferer\n\n";
exit;
}}
# _________________________________________________________
exit;
##### End of Script ########################################