A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: CGI Script

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    8
    I am trying to get an onscreen email.... http://www.tmghosting.ca/ian/email.html

    and I am not sure what all I have to do.... I am running on a winNT Server that has Perl installed on it. I am just not sure what files I have to have set up and in what directories....

    If anyone could help, I will give them a cookie

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    8
    I have no idea how this thing works.... I am trying to copy the code off of another site... I think he has a unix server can anyone tell me if this code is anything like what I want and why it isnt working?



    # d:/perl -w
    # contact webhostsolutions.ca
    # webhostsolutions.ca
    # 07/23/2000

    # use lib
    use 5;
    use strict;
    use CGI::Pretty;

    # limit 1000K bytes post, permit upload
    $CGI::POST_MAX = 1024 * 1000;
    $CGI:ISABLE_UPLOADS = 0;

    # initialize variables
    my $cgi = new CGI;
    my ($emailfrom, $subject, $message);

    $emailfrom = $cgi->param("emailfrom");
    $emailfrom =~ s/@/\@/;

    $subject = $cgi->param("subject");
    $subject = "Perl Email : " . $subject;

    $message = $cgi->param("message");
    $message =~ s/</&lt;/g;
    $message =~ s/>/&gt;/g;

    # print header
    print $cgi->header,
    $cgi->start_html("contact webhostsolutions.ca");

    print $cgi->h2("contact webhostsolutions.cal"),
    $cgi->hr(),
    $cgi->br();

    # print message, send email
    if (($emailfrom eq "") || !($emailfrom =~ /@/)
    || ($subject eq "contact webhostsolutions.ca : ") || ($message eq ""))

    {

    print $cgi->h3($cgi->font({-COLOR=>"#FF0000"},
    "Please go back and fill in your valid email address, subject and message."));

    } else {

    print $cgi->h3("Thank you for sending your email.");

    open(MAIL, '| c:\exchsrvr\ -t -oi');

    print MAIL <<EOF;
    To: $emailto
    From: $emailfrom
    Subject: $subject
    $message
    EOF

    close MAIL;

    }

    # print footer
    print $cgi->hr(),
    $cgi->a({-href=>"http://www.tmghosting.ca/ian/perl/email/email.cgi"},
    "Program Source"),
    $cgi->br();

    print $cgi->end_html();

  3. #3
    __OSX powered__ nucleuz's Avatar
    Join Date
    Aug 2000
    Location
    Norway
    Posts
    836
    What error messages does it spit out???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center