Link to home
Start Free TrialLog in
Avatar of aktnous
aktnous

asked on

Can't execute cgi files

I have an html form and i create the cgi file.Although the permisions of the directory that contains these two files are set ok when i post the form the page that appers cannot find the cgi file to execute.Plus i am in my first steps to these mechanism (form file that posted and a cgi file that being execute)
the cgi file:
# -------------------------------------------------------------------------
#  - Based on the HTML file, E:\netkids\cards\card.html


# -------------------------------------------------------------------------
# NOTES:
#        1. If editing, make sure that the control structure of script is not altered.
#        2. Save the edited file in text form.
#        3. Transfer this file to the WWW server in ASCII mode.
#        4. Set its protection to world read, execute (e.g. chmod 755 filename)

#        5. If your form contains edit controls named 'User_name',
#        'User_email' and 'Reply_to_email' (case-sensitive) they will
#  be used in the 'From:' field(s) of the E-mail. Otherwise it will be
#  'nobody' or 'unprivileged user'. (Tip: Include one or more of the above controls
#  in your form and make them mandatory)

#        6. Test the script on the server:
#             As a quick test, try running it from UNIX prompt by simply
# typing the name of this file as a shell command and see if any
# compilation error is reported. Then install the HTML and test via the form.

# -------------------------------------------------------------------------
# FREQUENT SOURCES of ERROR:
# 1. Error 500
#    a. Syntax error in script. Run it from UNIX commandline and check.
#    b. The 'perl' pathname is wrong. Try a 'whereis perl' from UNIX prompt.
# 2. Error sending mail
#    a. The mailer program is not correctly specified. Try 'whereis sendmail'
#    b. The /tmp directory is not writeable to the browser.
#       1. Replace 'local($filename) = "/tmp/cspro_$$.tmp";'
#         with 'local($filename) = "/yourdir/cspro_$$.tmp";',
#         where yourdir is the full pathname of a dir you
#         have set protections by 'chmod 777 dirname'.
#         If the CGI is in a dir owned by you, then set
#         its protection and '/tmp/cspro_$$.tmp' with 'cspro_$$.tmp'
# 3. Error 403 - Insufficient privilege
#    a. Set the protection on the CGI by 'chmod 755 cgifile'
# 4. Method not implemented
#    a. The extension, '.cgi', is not recognized. Try '.pl'
#    b. Ask your sysadmin for the exact file extension for the CGI
# -------------------------------------------------------------------------
# Start of the Perl script:

sub reformat
{
  local($tmp) = $_[0] ;
  $tmp =~ s/\+/ /g ;
  while ($tmp =~ /%([0-9A-Fa-f][0-9A-Fa-f])/)
  {
   $num = $1;
   $dec = hex($num);
   $chr = pack("c",$dec);
   $chr =~ s/&/and/g;  # Replace if it is the & char.
   $tmp =~ s/%$num/$chr/g;
  }
  return($tmp);
}
sub get_fields
{
   # Get the essential details from the form. These are the hidden fields added by the program
      # If there is no address to mail to. The Owner_email is also used to verify the expiry date
   if ($Owner_email eq "")
   {
      $No_Owner_Email = 1;
   }

   # The following are optional. If the user has included these it will be taken.
   if ($pquery =~ /User_name=([^&]*)&/)
   {
        $User_name = $1;
   }

   if ($pquery =~ /User_email=([^&]*)&/)
   {
        $User_email = $1;
   }

   if ($pquery =~ /Owner_email=([^&]*)&/)
   {
        $Owner_email = $1;
   }

   if ($pquery =~ /Reply_to_email=([^&]*)&/)
   {
        $Reply_to_email = $1;
   }
}

sub md_item_missing
{
   print "Content-type: text/html\n\n";
   print "<HEAD>\n";
   print "<TITLE>CGI*StarPro - Mandatory Item Missing</TITLE>\n";
   print "</HEAD>\n";
   print "<BODY BGCOLOR=\"#C0DCC0\">\n";
   print "<H1><Center>Error! - Mandatory field(s) missing </Center></H1>\n";
   print "<h2><Blink>One or more mandatory input missing.</Blink></h2>";
   print "Please fill in or select the following item(s) and press the submit button again: <br> <Font Color=red>";
   $md_item =  shift @missing_md_items;
   while ($md_item)
   {
     if (@Captions{$md_item}) { print "@Captions{$md_item}<br>\n"; }
     else { print "$md_item<br>\n"; }
     $md_item =  shift @missing_md_items;
   }
   print "</Font>";
   print "</BODY></Html>\n";
   exit;
}
sub check_mandatory_fields
{
  @mandatory_items_array = split (/\*/, "$Mandatory_Fields");  # Split it at the * char.
  $md_item =  shift @mandatory_items_array;  # The first is null. Shift this out
  $md_item =  shift @mandatory_items_array;  # The first is null. Shift this out
  @missing_md_items = ();  # Initialize the array
  while ($md_item)
  {
     $i = 0;
     # Initially add it to the array. Then remove it if found in the user input
     push (@missing_md_items, "$md_item");
     while (@user_input[$i])
     {
      $Item =  @user_input[$i];
      @Item_components = split (/=/, "$Item");
      if ($md_item eq @Item_components[0])
      {
         if (@Item_components[1])
         {
            $md_item = pop @missing_md_items;
            $i = $#user_input;  # Skip the rest of User_input. This will avoid the multiple select items from being counted more than once
         }
      }
      $i++;
     }
     $md_item =  shift @mandatory_items_array;
  }
  if (@missing_md_items) { &md_item_missing; }
}

sub parse_input
{
  if ($User_email)
  {
     if ($User_name) { print TFILE "From: \"$User_name\" <$User_email>\n"; }
     else { print TFILE "From: \"$User_email\" <$User_email>\n"; }
  }
  else
  {
     if ($User_name) { print TFILE "From: \"$User_name\" <No_Address>\n"; }
     else { print TFILE "From: \"No Name\" <No_Address>\n"; }
  }

  if ($Reply_to_email ne "")
  {
     print TFILE "Reply-To: <$Reply_to_email>\n";
  }
  else
  {
     if ($User_email) { print TFILE "Reply-To: \"$User_name\" <$User_email>\n"; }
  }
  print TFILE "To: $Owner_email\n";
  print TFILE "Subject: $Form_subject\n";

  if ($sponsorID) { print TFILE "Sponsor ID = $sponsorID\n"; }

  while (@user_input)
  {
      $Item =  shift @user_input;
      #replace the CR and LF, if any.
      $Item =~ s/\r/ /g;
      $Item =~ s/\n/ /g;
      @Item_components = split (/=/, "$Item");
      # If empty input is NOT to be sent, then check it. Otherwise reformat $Item and send it
      if ($Send_Empty_Field)
      {
         if ($Caption{@Item_components[0]})
         {
            print TFILE "$Caption{@Item_components[0]}\t=\t@Item_components[1]\n";
                if ($DisplayMailContentToUser) { push (@DisplayOnScreen, "$Caption{@Item_components[0]}      =      @Item_components[1]<br>\n");}
         }
         else
         {
            $Item =~ s/=/   = /g;  # Put a tab between the = sign and words on either side
            print TFILE "$Item\n";
         }
         if ($DisplayMailContentToUser) { push (@DisplayOnScreen, "$Item<br>\n");}
      }
      else
      {
         if (@Item_components[1])
         {
            if ($Caption{@Item_components[0]})
            {
               print TFILE "$Caption{@Item_components[0]}\t=\t@Item_components[1]\n";
                   if ($DisplayMailContentToUser) { push (@DisplayOnScreen, "$Caption{@Item_components[0]}      =      @Item_components[1]<br>\n");}
            }
            else
            {
               $Item =~ s/=/   = /g;  # Put a tab between the = sign and words on either side
               print TFILE "$Item\n";
            }
            if ($DisplayMailContentToUser) { push (@DisplayOnScreen, "$Item<br>\n");}
         }
      }
  }

  close (TFILE);
}

sub ErrorExit
{
   print "Content-type: text/html\n\n";
   print "<Html>\n";
   print "<Body bgColor=\"#FFFFFF\" Text=\"#000000\">\n";
   print "<H1>Error in writing temp file</H1>";
   print "Unable to write the temporary mail file in: $tmpDir <br>\n";
   print "Please check and ensure that this directory exists and has world write privilege.\n";
   print "<HR>\n";
   print "</Body>\n";
   print "</html>\n";
   exit;
}

sub TryAgainCreateTmpDir
{
   $tmpDir = "tmp";    # Within the CGI-bin
   mkdir ($tmpDir, 0000);
   $testFile = "$tmpDir/test.txt";
   chmod (0777, $tmpDir);
   open (TST, ">$testFile") || &ErrorExit;
   close (TST);
   unlink ($testFile);
}

sub CreateTmpDir
{
   mkdir ($tmpDir, 0000);
   $testFile = "$tmpDir/test.txt";
   chmod (0777, $tmpDir);
   open (TST, ">$testFile") || &TryAgainCreateTmpDir;
   close (TST);
   unlink ($testFile);
}
sub PostOrderAction
{
   if (!$mailerror)
   {
     unlink("$filename");
     if ($Acknowledgement)
     {
      print "Content-type: text/html\n\n";
      print "<HEAD>\n";
      print "<TITLE>CGI*StarPro - Acknowledgement</TITLE>\n";
      if ($RefreshHTML) { print "<META HTTP-EQUIV=\"refresh\" CONTENT=\"5; URL=$RefreshHTML\">\n";}
      print "</HEAD>\n";
   print "<BODY BGCOLOR=\"#C0DCC0\">\n";
      print "<H1><Center>Acknowledgement</Center></H1>\n";
      if ($User_name) { print "Dear $User_name, <p>\n"; }
      print "<H2><Font Color=\"#800040\">Your input has successfully been sent.</Font></H2>\n";
      if ($DisplayMailContentToUser)
      {
         print "<Font Color=\"#008000\">\n";
         print "<h3>The following data has been sent:</H3>\n";
         foreach $displayItem (@DisplayOnScreen)
         {
            print "$displayItem";\n         }
         print "</Font>\n";
      }
      print "$Acknowledgement<br>\n";
      print "</BODY></Html>\n";
     }
     else
     {
        if ($RefreshHTML) { print "location: $RefreshHTML\n\n";}
        else
        {
           print "location: /\n\n";
        }
     }
   }
   else
   {
      print "Content-type: text/html\n\n";
      print "<HEAD>\n";
      print "<TITLE>CGI*StarPro - Error Sending Mail</TITLE>\n";
      print "</HEAD>\n";
   print "<BODY BGCOLOR=\"#C0DCC0\">\n";
      print "<H1><Center>Error sending mail.</Center></H1>\n";
      print "<Blink>Error sending mail. Either the mailer program or the E_mail address is wrongly specified.</Blink>\n";
      print "</BODY></Html>\n";
   }
}
sub do_mail
{
   $filename = "$tmpDir/cspro_$$.tmp";
   open(TFILE,">$filename") || &CreateTmpDir;
   &parse_input;
   if ($Owner_email !~ / /) { `postmail -H mail.nous.gr -t $Owner_email < $filename`; }
   $mailerror = $?;
   &PostOrderAction;
}
sub InitializeVariables
{
   $Owner_email="netkids\@nous.gr";
   $Owner_name="";
   $Acknowledgement="<h2>Thank you for your order/feedback.</h2><h3>We will contact you shortly.</h3>";
   $Form_subject="";
   $RefreshHTML="http://www.netkids.gr/";
   $DisplayMailContentToUser="Yes";
}

sub GetSponsorCookie
{
      # Module to obtain the sponsorID if the site has implemented Site*Sponsor
   $sponsorID = "";
   @words = ();
   $cookies  = $ENV{'HTTP_COOKIE'};
   if (!$cookies) { return; }

   @cookiesArray = split (/;/, "$cookies");
   foreach $cookieItem (@cookiesArray)
   {
      if ($cookieItem =~ /SiteSponsor/)
      {
         @words = split (/=/, "$cookieItem");
      }
   }
   $sponsorID = @words[1];
}
# Main body of the script
sub do_main
{
  $cv = 1;
  $cl = $ENV{'CONTENT_LENGTH'};
  if ($cl > 0)
  {
   read(STDIN, $_, $cl);
   $_ .= "&"; # Append an & char so that the last item is not ignored
   $pquery = &reformat($_);

   $No_Owner_Email = 0; # Initially assume that it is available.
   &InitializeVariables;
   &get_fields;
   &GetSponsorCookie;  # Get the sponsorID if the site has implemented Site*Sponsor
   if ($No_Owner_Email)
   {
      print "Content-type: text/html\n\n";
      print "<HEAD>\n";
      print "<TITLE>CGI*StarPro - No E_Mail address</TITLE>\n";
      print "</HEAD>\n";
      print "<BODY BGCOLOR=\"#C0DCC0\">\n";
      print "<H1>Error... No E_mail Address</H1>\n";
      print "<Hr><Blink>E_mail Address to send the form input is missing. Aborting the CGI... </Blink> <Hr> \n";
      print "</BODY></Html>\n";
      unlink("$filename");
      exit;
   }
   @user_input = split (/&/, "$pquery");  # Split it at the & char.
   &check_mandatory_fields;

   if ($mailTheContents) { &do_mail; }
   unlink("$filename");
  }
}

$mailTheContents = 1;
$tmpDir = "/tmp";
$|=1;
&do_main;
sleep(1);

# ***** End of the Perl Script file. *****

the html file:
<FORM Method="POST" Action="/cgi-bin">
<HTML>                                                                          
<BODY BACKGROUND="./images/back1.gif">
<A NAME="TOP">
<CENTER>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>HOW TO SEND A BIRD GREETING
   CALL CARD</B></FONT>
 <BR>
 <FONT FACE="ARIAL">
 Sending a card is easy with BigNoseBird.Com's Virtual Bird
 Greeting Call script. Just follow the instructions at each
 step along the way. I also want to let you know that the cards
 are stored in a non-indexed directory so only you and the
 recipient will know how to find the card. This directory
 is also pretty secure from spammers, so send your card
 knowing you will not end up on any junk list.
 <P>
 After you have completed the card, you will be shown a
 preview. If you do not like your card, you may edit it
 and then send it, or just cancel the request.
 The recipient will receive e-mail advising where
 to find the card.
 <P>
 </FONT>
 </TD>
 </TR>
</TABLE>
<P>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>STEP #1: PICK A PICTURE
   </B></FONT>
 <BR>
 <FONT FACE="ARIAL">
 Please select a picture from the list below using the little
 <I>Radio Button</I> selector. You may only pick one picture
 per card. If you want to see a full size image of a picture,
 just click on it. You might want to do that before filling
 in any information on this page, just so you do not risk losing
 your work after returning from viewing the image.
 </FONT>
 </TD>
 </TR>
</TABLE>
<P>
<FORM Method="POST" Action="/fpdb/card.cgi">
<!-- CGI*StarPro; CodeBegin -->
<Input Type=Hidden Name=Owner_email Value="netkids@nous.gr">
<Input Type=Hidden Name=Authorization_code Value="CP0607-US173-94235">
<Input Type=hidden Name=Acknowledgement Value="<h2>Thank you for your order/feedback.</h2><h3>We will contact you shortly.</h3>">
<Input Type=hidden Name=Form_subject Value="ÓÔÅÉËÅ ÌÉÁ ÊÁÑÔÁ">
<Input Type=hidden Name=RefreshHTML Value="http://www.netkids.gr/">
<Input Type=hidden Name=DisplayMailContentToUser Value="Yes">
<!-- CGI*StarPro; CodeEnd -->
<TABLE WIDTH=500 BORDER=1 BGCOLOR="#FFFFFF">
 <TR>
 <TD WIDTH=75>
  <A HREF="./cards/irish.jpg">
  <IMG SRC="./cards/tnailir.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
  </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="irish.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The Luck 'O the Irish Bignosebird</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
Once thought limited only to the warmest climes, our ever diligent
search teams found this specimen with a pot of gold. Here is the bird.
The gold is gone and so is the search team... Wish your friends the
best of Irish luck with this prized card. It is said that if you bend
over backwards and kiss the screen while this bird is displayed, you
too will have everlasting luck. You also will have lip marks on your
monitor, which could seriously worry your spouse and/or co-workers.
 </FONT>
 </TD>
 </TR>
 <TR>
 <TD WIDTH=75>
  <A HREF="./cards/longbird.jpg">
  <IMG SRC="./cards/tnaillb.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
  </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="longbird.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The Long Stem Bignosebird</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
 Nothing expresses love and affection better than a fresh picked
 Long Stem Bignosebird. Our's are hand harvested from the garden
 daily. Let that special person know you care enough to send
 them only the finest.
 </FONT>
 </TD>
 </TR>
 <TR>
 <TD WIDTH=75>
  <A HREF="./cards/getwell.jpg">
  <IMG SRC="./cards/tnailgw.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
  </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="getwell.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The Feel Better Bignosebird</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
Have a friend or loved one a bit under the weather? Sometimes it just
takes a little perspective to perk people up. Let the patient know that
they are in much better shape than this former member of our
aerobatics team.
 </FONT>
 </TD>
 </TR>
 <TD WIDTH=75>
  <A HREF="./cards/birthday.jpg">
  <IMG SRC="./cards/tnailbt.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
  </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="birthday.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The Birthday Bignosebird</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
 Do you know somebody who has a birthday coming up? Our Birthday Bignosebird
 with hat and cake makes just the perfect gift. Priced right too! Tight
 for time? No problem. Your gift will arrive in just minutes anyplace on
 Earth.

 </FONT>
 </TD>
 </TR>
 <TR>
 <TD WIDTH=75>
 <A HREF="./cards/babybird.jpg">
 <IMG SRC="./cards/tnailbb.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
 </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="babybird.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The New Baby BignoseBird</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
 Here is the perfect choice for a friend or family member that has
 recently added to their nest. This museum quality print will surely
 become their wallpaper image for generations to come.
 </FONT>
 </TD>
 </TR>
 <TR>
 <TD WIDTH=75>
  <A HREF="./cards/santabird.jpg">
  <IMG SRC="./cards/tnsanta.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
  </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="santabird.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The Santa BigNoseBird</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
 Why head for the mall this year? Do you have that special somebody
 that is hard to shop for? You checked your list and are not quite
 sure where they are on the lump of coal to Rolex watch continuum.
 Well, this card is just the right virual stocking stuffer. When
 printed, it makes the ideal tree ornament.
 </FONT>
 </TD>
 </TR>
 <TR>
 <TR>
 <TD WIDTH=75>
  <A HREF="./cards/hannuka.jpg">
  <IMG SRC="./cards/tnhannuka.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
  </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="hannuka.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The Festival of BigNoseBirds</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
 <I>Oy veh ist mir!</I> Eight nights of festivities and gift giving.
It sort of makes shopping just worse than doing it in dog years.
This finely crafted menorah will be cherished by those that receive it.
Any idea how hard it was to pose all those birds?
<BR>
*NOT UL certified. Keep away from flame.
 </FONT>
 </TD>
 </TR>
 <TR>
 <TD WIDTH=75>
  <A HREF="./cards/turkey.jpg">
  <IMG SRC="./cards/tnailtk.jpg" HEIGHT=107 WIDTH=75 BORDER=1>
  </A>
 </TD>
 <TD WIDTH=25 BGCOLOR="#FFFFCC">
  <INPUT TYPE="radio" NAME="pic_select"
    VALUE="turkey.jpg">
 </TD>
 <TD WIDTH=400 BGCOLOR="#99FF99" VALIGN=TOP>
 <CENTER><FONT SIZE="+2"><B>The Holiday Dinner Bignosebird</B></FONT></CENTER>
 <FONT FACE="ARIAL" SIZE="-1">
 Turkey again? No way! Break from tradition this year and send the
 Holiday Dinner Bignosebird. Each bird is guaranteed fresh from our
 farm to your dear friend's screen. Recipes not included.
 </FONT>
 </TD>
 </TR>
</TABLE>
<P>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>STEP #2: NAME AND E-MAIL INFORMATION
   </B></FONT>
 <BR>
 <FONT FACE="ARIAL">
 In the boxes below, please enter both your's and the recipient's name
 and e-mail addresses.
 </FONT>
 </TD>
 </TR>
</TABLE>
<P>
<FONT FACE="ARIAL" COLOR="#0000FF">
  <B>PLEASE BE CERTAIN OF RECIPIENT'S E-MAIL ADDRESS</B>
</FONT>
<TABLE BGCOLOR="#99FF99" BORDER=1 WIDTH=500>
 <FONT FACE="ARIAL">
 <TR>
 <TD ALIGN=RIGHT>Your Name:</TD>
 <TD ALIGN=LEFT><INPUT TYPE="TEXT" NAME="sender_name" MAXLENGTH=100 SIZE=35></TD>
 </TR>
 <TR>
 <TD ALIGN=RIGHT>Your E-Mail Address:</TD>
 <TD ALIGN=LEFT><INPUT TYPE="TEXT" NAME="sender_email" MAXLENGTH=70 SIZE=35></TD>
 </TR>
 <TR>
 <TD ALIGN=RIGHT>Recipient's Name:</TD>
 <TD ALIGN=LEFT><INPUT TYPE="TEXT" NAME="recip_name" MAXLENGTH=100 SIZE=35></TD>
 </TR>
 <TR>
 <TD ALIGN=RIGHT>Recipient's E-Mail Address:</TD>
 <TD ALIGN=LEFT><INPUT TYPE="TEXT" NAME="recip_email" MAXLENGTH=70 SIZE=35></TD>
 </TR>
 </FONT>
</TABLE>
<P>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>STEP #3: SELECT YOUR TEXT AND
   BACKGROUND COLORS
   </B></FONT>
 <BR>
 <FONT FACE="ARIAL">
 Using the two selector pulldowns below, please select your text and
 background colors. The script will not check to see if you have both
 colors set the same, so if you want your recipient to be able to read
 the card, please select two different colors!
 </FONT>
 </TD>
 </TR>
</TABLE>
<P>
<TABLE BGCOLOR="#99FF99" BORDER=1 WIDTH=500>
 <FONT FACE="ARIAL">
 <TR>
 <TD ALIGN=CENTER>
TEXT COLOR  <SELECT NAME="text_color">
   <OPTION SELECTED VALUE="#000000">BLACK
   <OPTION VALUE="#FF0000">RED
   <OPTION VALUE="#00FF00">GREEN
   <OPTION VALUE="#0000FF">BLUE
   <OPTION VALUE="#99FFFF">SKY BLUE
   <OPTION VALUE="#FFFF33">YELLOW
   <OPTION VALUE="#9933FF">PURPLE
   <OPTION VALUE="#FF9933">ORANGE
       </SELECT>
   </TD>
   <TD ALIGN=CENTER>
BACKGROUND  <SELECT NAME="back_color">
   <OPTION SELECTED VALUE="#FFFFFF">WHITE
   <OPTION VALUE="#000000">BLACK
   <OPTION VALUE="#FF0000">RED
   <OPTION VALUE="#00FF00">GREEN
   <OPTION VALUE="#0000FF">BLUE
   <OPTION VALUE="#99FFFF">SKY BLUE
   <OPTION VALUE="#FFFF33">YELLOW
   <OPTION VALUE="#9933FF">PURPLE
   <OPTION VALUE="#FF9933">ORANGE
       </SELECT>
 </TD>
 </TR>
</FONT>
</TABLE>
<P>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>STEP #4: ENTER YOUR TITLE &amp;
   MESSAGE</B></FONT>
 <BR>
 <FONT FACE="ARIAL">
 In the box below, please enter your message. Please feel free to
 use HTML to express yourself!
 <P>
 </FONT>
 </TD>
 </TR>
</TABLE>
<P>
<TABLE BGCOLOR="#99FF99" BORDER=1 WIDTH=500>
 <FONT FACE="ARIAL">
 <TR>
 <TD ALIGN=CENTER>
 Card Title  
 </TD>
 <TD ALIGN=CENTER>
<INPUT TYPE="TEXT" NAME="the_title" MAXLENGTH=75 SIZE=55>
 </TD>
 </TR>
 <TR>
 <TD ALIGN=CENTER>
 Your Message
 </TD>
 <TD ALIGN=CENTER>
   <TEXTAREA NAME="the_message" WRAP=VIRTUAL ROWS=4 COLS=60></TEXTAREA>
 </TD>
 </TR>
 </FONT>
</TABLE>
<P>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>STEP #5: SIGN YOUR CARD
   </B></FONT>
 <BR>
 <FONT FACE="ARIAL">
 Please fill in below, how you would like to sign your card. Examples
 would be:
 </FONT>
 </TD>
 </TR>
 <TR>
 <TD>
<TABLE BGCOLOR="#99FF99" BORDER=1 WIDTH=500>
 <FONT FACE="ARIAL">
 <TR>
 <TD>
  <UL>
    <LI>Love, Snookums
    <LI>Best Wishes, Fred
    <LI>Me!
  <UL>
  </TD>
  <TD ALIGN=CENTER>
 <INPUT TYPE="TEXT" NAME="sig_line" MAXLENGTH=100 SIZE=35></TD>
 </TD>
 </TR>
</TABLE>
 </TD>
 </TR>
</TABLE>
<P>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>STEP #6: Pick a Song!
   </B></FONT>
 <BR>
 <FONT FACE="ARIAL">
  Please make a selection or skip this step for no music.
 </FONT>
  <UL>
<SELECT NAME="midifile">
    <OPTION VALUE="">No Music Selected
    <OPTION VALUE="addicted.mid">Addidcted to Love
    <OPTION VALUE="alloveru.mid">All Over You
    <OPTION VALUE="bestfriend.mid">You're My Best Friend
    <OPTION VALUE="birthday.mid">Birthday
    <OPTION VALUE="doyaloveme.mid">Do Ya Love Me
    <OPTION VALUE="holdyrhand.mid">I Want to Hold Your Hand
    <OPTION VALUE="itsinyreyes.mid">It's in Your Eyes
    <OPTION VALUE="itsmyparty.mid">It's My Party
    <OPTION VALUE="thatthing.mid">That Thing You Do
    <OPTION VALUE="walksunshine.mid">Walking on Sunshine
    </SELECT>
  </UL>
 </TD>
 </TR>
</TABLE>
<P>
<TABLE WIDTH=500>
 <TR>
 <TD>
 <FONT FACE="ARIAL" COLOR="#FF0000"><B>STEP #7: PROCEED TO PREVIEW OR START
  OVER
   </B></FONT>
 <BR>
 <FONT FACE="ARIAL">
  You are now ready to preview your card! To do so, just click on the
  PREVIEW button below. If you want to clear the form and start all over,
  select START-OVER. Your card will not be sent until you press the
  SEND-CARD button on the preview screen.
  <P>
  <CENTER>
<INPUT TYPE="submit" VALUE="PREVIEW">
<INPUT TYPE="reset" value=" START-OVER">
<INPUT TYPE="HIDDEN" NAME="action_code" VALUE="NEW">
  </CENTER>
 </FONT>
 </TD>
 </TR>
</TABLE>
</FORM>
<HR WIDTH="550">                    
</CENTER>                            
 <P>
</BODY>
</HTML>







Avatar of BillyAbbott
BillyAbbott
Flag of United Kingdom of Great Britain and Northern Ireland image

first line of the html file...

<FORM Method="POST" Action="/cgi-bin">

you haven;t given a filename for the action of the form. put the correct filename and it might work.
Avatar of aktnous
aktnous

ASKER

In the first line the post action is /cgi-bin/card.cgi
ASKER CERTIFIED SOLUTION
Avatar of oostwijk
oostwijk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aktnous

ASKER

In an NT based system where is the path for perl?And if there is not what i have to to?