Click to See Complete Forum and Search --> : PERL sendmail /form with confirmation form


Webnew
07-10-2009, 09:56 PM
Hello All,

I'm new for this forum.

I'm learning about web programming and I'm stuck at my form page. I'm using PERL form for my contact us form and when I click on submit button, I'm not getting my confirmation.shtml which is included with my header, navigation and footer.

My question is what I should do so, when I click on submit button, I get the confirmation.shtml page.

Thanks.

Here is my sendmail.pl code.

#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
$title= 'Acme Mail Confirmation';
$to= 'webdevteacher@gmail.com';
$from= 'cooks@yahoo.com';
$subject= 'Acme Mail Confirmation';
open(MESSAGE, "|/usr/sbin/sendmail");
## MESSAGE Header
print MESSAGE "To: $to\n";
print MESSAGE "From: $from\n";
print MESSAGE "Subject: $subject\n\n";
close(MESSAGE);
## HTML content lets user know we sent an email
print "<html><head><title>$title</title><head>\n<body>\n\n";

print "<h1>$title</h1>\n";
print "<p>Hello Friend,\n";
print "<p>Thank you for visiting Acme Indian Arts Store. Also thank you for your feedback. If you have provided your email address, we will contact shortly.\n";
print "<p>Thank you for your patronage.\n";
print "<p>A message has been sent from $from to $to";
print "\n\n</body></html>";


Also I have a separate Shtml for confirmation which is called confirmation.shtml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- BOF: Generated Meta Tags -->
<meta name="description" content="Acme Widget - the Indian Art Store of your choice." />
<meta name="keywords" content="Arts and Crafts, Statues, Jewelry, Paintings, Spiritual Accessories." />
<meta name="author" content="P-----y, Web Developer" />
<meta name="copyright" content="2009, P-------y" />
<meta name="reply-to" content="info[at]acmewidget.com" />
<title>Acme Widget - Arts and Crafts of India</title>
<!-- EOF: Generated Meta Tags -->

<link rel="stylesheet" href="css.sheet1.css" type="text/css" />
<script type="text/javascript">
<!-- Hide from old browsers
function createWindow(cUrl,cName,cFeatures)
{
var xWin = window.open(cUrl,cName,cFeatures)
}
//-->
</script>
</head>
<body>
<!--#include virtual="/header.inc" -->

<!--#include virtual="/navigation.inc" -->

<div class="headerphoto"></div>

<div style="text-align:center;font-size:xx-large;margin-top:100px;margin-bottom:100px">Thank you for your inquiry.
</div>
<!-- end of Main Content -->

<!--#include virtual="/footer.inc" -->

</body>
</html>

perl_diver
07-11-2009, 01:23 AM
What do you want to display after the email is sent? The "THank you" message that is part of your perl code or the shtml page? If you want the shtml page:

#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
$title= 'Acme Mail Confirmation';
$to= 'webdevteacher@gmail.com';
$from= 'cooks@yahoo.com';
$subject= 'Acme Mail Confirmation';
open(MESSAGE, "|/usr/sbin/sendmail");
## MESSAGE Header
print MESSAGE "To: $to\n";
print MESSAGE "From: $from\n";
print MESSAGE "Subject: $subject\n\n";
close(MESSAGE);

my $shtml = 'http://www.example.com/thankyou.shtml';
print "Location: $shtml\n\n";
exit;

Webnew
07-11-2009, 08:55 PM
After I click on "Submit" button, it's give me this message. I'm not getting my confirmation page with header and navigation. I like to indirect to my confirmation page.

Location: http://student345.webdev.scc-fl.edu/confirmation.shtml

perl_diver
07-12-2009, 05:11 PM
After I click on "Submit" button, it's give me this message. I'm not getting my confirmation page with header and navigation. I like to indirect to my confirmation page.

Location: http://student345.webdev.scc-fl.edu/confirmation.shtml

I have no idea what any of that means. Did you try the code I posted for you? Did you edit the $shtlm variable to point to your .shtml page?