Static Portion of Perl Form - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > Other Programming - Perl, C++, Java, ASP, .NET Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-17-2009, 09:53 AM   #1 (permalink)
Junior Member
 
Join Date: Mar 2009
Posts: 3
Default Static Portion of Perl Form

What is the area on a Perl form that is considered the static portion? My form is below. I need to add text after the static portion. Thank you.

#!c:/perl/bin/Perl.exe
##
## emailFormData.pl -- Sends form data to email recipient(s) listed in hidden

form field emailto
## Expects to

receive two form params: formname, emailto
## formname

- self explanatory, the name of the form
## emailto

- a comma separated list of email addresses
##

can be as little as one or multiple email addresses
##

examples:
##

SomeEmail@somedomain
##

SomeEmail@somedomain.com,SomeEmail@somedomain.com
##

use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use Net::SMTP;

my $query = new CGI;

my $formname = param('formname');
my $emailfrom = param('emailfrom');
my $emailto = param('emailto');
my $emailsubject = param('emailsubject');
my $print_debug_info = 'no';
my $sendEmail = 'yes';
my $error_message = '';
my $error = 0;

my ($var, $name, $value, $val);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isd st) = localtime(time);
$year = $year + 1900;
$mon = $mon + 1;
my $today_date = $mon.'/'.$mday.'/'.$year;
my $ampm = ' am';
if ($hour > 12) {
$hour = $hour - 12;
$ampm = ' pm';
}
my $today_time;
if ($min < 10) {
$today_time = $hour.':0'.$min.$ampm;
} else {
$today_time = $hour.':'.$min.$ampm;
}

my @keywords = $query->keywords;
my @names = $query->param;

print $query->header(-expires=>'now');
print $query->start_html(-title=>'Email Form Data');

my $emailText = '';
my $displayText = '<b>requestor_IP : </b>'.$ENV{'REMOTE_ADDR'}.'<br>'.
'<b>script_name :

</b>'.$ENV{SCRIPT_NAME}.'<br>';
my $kntr = 0;
foreach my $name (@names) {
if ( lc($name) ne 'submit' ) {
if ( lc(param($name)) eq 'checkbox') {
$emailText .= $name.': CHECKED'."\n";
$displayText .= '<b>'.$name.'</b>:

'.param($name).'<br>';
} else {
$emailText .= $name.': '.param($name)."\n";
$displayText .= '<b>'.$name.'</b>:

'.param($name).'<br>';
}
}
$kntr++;
}
$emailText =~ s/_/ /g; ## Replace underscores with spaces
$displayText =~ s/_/ /g; ## Replace underscores with spaces
$emailText =~ s/checkbox/Yes/g; ## Replace word checkbox with Yes
$displayText =~ s/checkbox/Yes/g; ## Replace word checkbox with Yes


if ( $print_debug_info eq 'yes' ) {
print $query->Dump;
print '<h4>'.$displayText.'</h4>';
}

my @distList = split(",", $emailto );
if ( $sendEmail eq 'yes' ) {
foreach my $sendTo ( @distList ) {
#print "<h4> email sent to $sendTo".'</h4>';
Send_Email($emailfrom, $sendTo, $emailsubject, $emailText);
}
print qq!<h4>
Thank you.<br>

Your request has been submitted and a

Teambuildinginc.com
consultant will contact you within 2 business

days to provide you with a proposal based on your situation and needs. <br>
To return to the Teambuildinginc.com site: <a

href="http://www.teambuildinginc.com">Click Here</a> </h4>!;
}
print $query->end_html;
exit;


###########################################
sub Send_Email() {
my ($MailFrom, $MailTo, $Subject, $Body, $ServerName) = ( @_ );

my $testonly = 1;

if ($MailFrom eq '') { $MailFrom = 'inquire@teambuildinginc.com'; }
if ($MailTo eq '') { $MailTo = 'inquire@teambuildinginc.com'; }
if ($Subject eq '') { $Subject = "Subject"; }
if ($Body eq '') { $Body = "Body"; }


if ($testonly == 1) {
$Subject = $Subject;
}

if ($ServerName eq '') { $ServerName = "localhost"; }

# Create a new SMTP object
my $smtp = Net::SMTP->new($ServerName);

# If you can't connect, don't proceed with the rest of the script
die "Couldn't connect to server" unless $smtp;

$smtp->mail( $MailFrom );
$smtp->to( $MailTo );
$smtp->data();

# Send the header
# This address will appear in the message
$smtp->datasend('To: '.$MailTo."\n");

# So will this one
$smtp->datasend('From: '.$MailFrom."\n");
$smtp->datasend("Subject: $Subject\n");
$smtp->datasend("\n");

# Send the Body.
$smtp->datasend("$Body\n\n");

# Send the termination string
$smtp->dataend();

# Close the connection
$smtp->quit();
}
CAP_TBP is offline   Reply With Quote
Sponsored Links
Old 05-19-2009, 04:44 PM   #2 (permalink)
Junior Member
 
Join Date: Mar 2008
Posts: 17
Default Re: Static Portion of Perl Form

I think what you're looking for is this portion:

PHP Code:
print qq!<h4>
Thank you.<br>

Your request has been submitted and a

Teambuildinginc
.com
consultant will contact you within 2 business

days to provide you with a proposal based on your situation 
and needs. <br>
To return to the Teambuildinginc.com site: <a

href
="http://www.teambuildinginc.com">Click Here</a> </h4>!; 
awatson is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 06:38 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting