|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/abtechsci/cgi-bin/ |
Upload File : |
#! /usr/bin/perl
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
use CGI;
my $recipient = param('recipient');
# my $recipient = '[email protected]';
my $subject = param('subject');
my $content = " Dear Admin , <br > \t\t A customer has completed the survey and the customer details are as follows, <br> ";
my %form;
foreach my $p (param())
{
$form{$p} = param($p);
if($p ne "recipient" && $p ne "subject" && $p ne "redirect" && $form{$p} ne "" && $form{$p} ne "none")
{
# print MAIL "$p : $form{$p} \n";
$content = $content . "$p : $form{$p} <br>" ;
}
}
open (Fopen,">>Customer.csv");
my %form;
foreach my $p(param())
{
$form{$p} = param($p);
if($p ne "recipient" && $p ne "subject" && $p ne "redirect" && $p ne "DISCIPLINE" && $p ne "APPLICATIONS" && $p ne "LITERATURE")
{
print Fopen "$form{$p} ,";
}
}
my @applications = param("APPLICATIONS");
if(scalar(@applications) == 0)
{
print Fopen "No selection ,";
}
else
{
foreach my $application(@applications)
{
print Fopen "$application ;";
}
print Fopen " ,";
}
my @Discipline = param("DISCIPLINE");
if(scalar(@Discipline) == 0)
{
print Fopen "No Selection ,";
}
else
{
foreach my $discipline(@Discipline)
{
print Fopen "$discipline ;";
}
print Fopen " ,";
}
my @Literature = param("LITERATURE");
if(scalar(@Literature) == 0)
{
print Fopen "No Selection ";
}
else
{
foreach my $literature(@Literature)
{
print Fopen "$literature ;";
}
}
print Fopen " \n";
close(Fopen);
my $cmd ='whereis sendmail';
print header;
# -head=>meta({-http_equiv => 'refresh', -content => '5;URL=http://abtechsci.com/index.html'}),
print start_html(-title=>'Customer Survey',-script=>{-type=>'text/javascript',-code=>'window.onload=function(){ document.myform.submit(); }'});
print start_form( -method=>'POST',-action=>'../sendemail.php',-name=>'myform');
print hidden('recipient',$recipient);
print " \n";
print hidden('subject' ,$subject);
print " \n";
print hidden('content' ,$content);
print " \n";
print hidden('srce', "Customerserv");
print end_form;
print end_html;
sub dienice
{
print header;
print start_html;
my($errmsg) = @_;
print "<h2>Error</h2>\n";
print "<p>$errmsg</p>\n";
print end_html;
exit;
}