1. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    I'm totally new in this stuff, i just started with perl. I know how to set up some basic script and stuff, but that's it. I'm from the netherlands, so don't blame me on my bad english.

    I want to make an html form that sends an email back depending on the age.
    Example: for age 8-14 send email 1
    for age 15-23 send email 2


    Is there a script somewhere what is able to do such things, or is there anybody who can help me?


    [This message has been edited by matthijs (edited 10-29-99).]
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    OK here's a basic outline of how to do it,
    I'm presuming you have the ages, email adresses and cgi-access of course

    if ($age <= 14) {

    open MAIL, "|mail $emailaddress" or die $!;
    print MAIL "You're to young to see the movie";
    close MAIL or die $!;


    else {
    open MAIL "|mail $emailaddress" or die $!;
    print MAIL "You can see the movie";
    close MAIL or die $!;


    And that's basically it.
    You can treat the 'mail' program as you would a file handle. Just don't forget to insert the pipe.

IMN logo majestic logo threadwatch logo seochat tools logo