Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0

    Exclamation Internal Server Error??? Help with FormMail


    Ok, So I bought a template from a web template site thinking that everything I needed would be provided, but I was waaaaay off! I got every thing setup and running except the Mail Form. I really am not all that savvy on coding and I'm more of a designer... this is why I have no clue what's going on. I've spent about 15 hours trying to figure out whats wrong but I can't for the life of me???

    I punched in what I thought was all I needed in the actual code on the "contacts Page" but it's still not working? below is the Mail Form code(in Red) from the page. Does this look like it should function if it was directed to the "MailForm.pl" file correctly?

    And I keep hearing about a redirect after the submit buttons pushed? does it look like this is in this code (in red)?

    after I hit submit this is what I get "Internal Server Error, The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator,(e mail address) and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log."

    <form id="form" action="web address/cgi-bin/FormMail.pl" enctype="multipart/form-data">
    <div class="line"><input type="text" value="name:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="title:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="company name:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="address:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="address cont'd:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="city:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="state:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="e-mail:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="phone:" onfocus="this.value=''" /></div>
    <div>
    <textarea cols="30" rows="40" onfocus="this.value=''">message:</textarea><br />
    <a href="#" class="link_3" onclick="getElementById('form').submit()">send</a> <a href="#" class="link_3" onclick="getElementById('form').reset()">clear</a>
    </div>
    </form>


    This is what my FormMail.pl looks like (in gray).

    # USER CONFIGURATION SECTION
    # --------------------------
    # Modify these to your own settings. You might have to
    # contact your system administrator if you do not run
    # your own web server. If the purpose of these
    # parameters seems unclear, please see the README file.
    #
    BEGIN
    {
    $DEBUGGING = 1;
    $emulate_matts_code= 0;
    $secure = 1;
    $allow_empty_ref = 1;
    $max_recipients = 5;
    $mailprog = '/usr/lib/sendmail -oi -t';
    $postmaster = 'info@mysite.com';
    @referers = qw(mysite.com);
    @allow_mail_to = qw(info@mysite.com);
    @recipients = qw(info@mysite.com);
    %recipient_alias = ();
    @valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
    $locale = '';
    $charset = 'iso-8859-1';
    $date_fmt = '%A, %B %d, %Y at %H:%M:%S';
    $style = '/css/nms.css';
    $no_content = 0;
    $double_spacing = 1;
    $wrap_text = 0;
    $wrap_style = 1;
    $send_confirmation_mail = 0;
    $confirmation_text = <<'END_OF_CONFIRMATION';
    From: (you@your . com)
    Subject: form submission

    Thank you for your form submission.

    END_OF_CONFIRMATION


    if anyone can help I would really really appreciate it! I'm getting reamed out because the mail page doesn't work and I have no clue where to even start???

    Thanks for any and all help!
    Last edited by mykkah; September 19th, 2008 at 11:44 AM. Reason: text color
  2. #2
  3. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,274
    Rep Power
    0
    I would recommend looking at the end of the webserver error log as suggested. The error should be displayed there.

    Is this what your form action says?
    Code:
    <form id="form" action="web address/cgi-bin/FormMail.pl" enctype="multipart/form-data">
    You should substitute your site name where it says 'web address', although this action should be sufficient:
    Code:
    action="/cgi-bin/FormMail.pl"
    Make sure the script is named FormMail.pl (case counts), and make sure it is executable.

    Top of your script should look something like this:
    Code:
    #!/usr/bin/perl
    On most operating systems, the path is important (Windows may be the exception, I'm never really sure). Immediately under that line you can add
    Code:
    use CGI::Carp qw/fatalsToBrowser/;
    and errors should be displayed for you in the browser. I'm sure we can do more to track down the problem.

    Oh, also your BEGIN block does not end in a } curly brace. You may have just cropped it out when cutting and pasting. Did you remember to make the FormMail.pl file in the /cgi-bin directory executable?
    Last edited by keath; September 19th, 2008 at 12:11 PM. Reason: eliminate a redundancy
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,459
    Rep Power
    653
    From what you posted this does not look like a perl issue but rather a web server issue. What http server are you using and are you sure the perl script is in the correct directory for the server? There are likely several server settings that need to be configured for cgi scripts to work. Do you have other cgi scripts that are currently working?
  6. #4
  7. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2004
    Location
    Sunny Southern California
    Posts
    2,687
    Rep Power
    865
    Originally Posted by gw1500se
    From what you posted this does not look like a perl issue but rather a web server issue. What http server are you using and are you sure the perl script is in the correct directory for the server? There are likely several server settings that need to be configured for cgi scripts to work. Do you have other cgi scripts that are currently working?
    True, but he probably can't reconfigure the server, but he can (hopefully) reconfigure the script so the server runs it properly.

    500 error indicates:

    • incorrect path to perl
    • incorrect transfer mode from client to server
    • possibly incorrect file permissions
    • possibly not printing a complete set of http headers before printing output
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0
    Originally Posted by gw1500se
    From what you posted this does not look like a perl issue but rather a web server issue. What http server are you using and are you sure the perl script is in the correct directory for the server? There are likely several server settings that need to be configured for cgi scripts to work. Do you have other cgi scripts that are currently working?
    I believe that all the server side stuff should be fine? I host with "hostway" and in their support they offer free scrips for FormMail and others...

    All I did was click reinstall FormMail and it automatically generated the script and put it in the folder?

    The website is w w w . a s e t c o r p . c o m and the form is on the contacts page...

    My original post was an example but below is the actual code for the form on the page "execpt for the extra spaces since this wont let me post urls":

    <form id="form" action="h t t p : / / w w w . a s e t c o r p . c o m / c g i - b i n / F o r m M a i l . p l" enctype="multipart/form-data">
    <div class="line"><input type="text" value="name:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="title:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="company name:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="address:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="address cont'd:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="city:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="state:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="e-mail:" onfocus="this.value=''" /></div>
    <div class="line"><input type="text" value="phone:" onfocus="this.value=''" /></div>
    <div>
    <textarea cols="30" rows="40" onfocus="this.value=''">message:</textarea><br />
    <a href="#" class="link_3" onclick="getElementById('form').submit()">send</a> <a href="#" class="link_3" onclick="getElementById('form').reset()">clear</a>
    </div>
    </form>

    I have the permissions set on the FormMail file to 755 so that should be correct?

    I'm not sure what else to try?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0
    just a side note... I use a mac, not sure if that matters...
  12. #7
  13. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2004
    Location
    Sunny Southern California
    Posts
    2,687
    Rep Power
    865
    ask your host to resolve the issue. Since it is a script they provide for you they might help you with getting it running although typically hosts do not provide support for scripts.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0
    Originally Posted by KevinADC
    ask your host to resolve the issue. Since it is a script they provide for you they might help you with getting it running although typically hosts do not provide support for scripts.
    Ya I tried that last night... they basically said that they don't get paid to do that... I was like ok?

    Does the html form code look like it should work? I'm not sure what's right and whats wrong. I'm trying to trouble shoot, but I have no clue where the problem is?

    How do I look at the server errors?
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,459
    Rep Power
    653
    What about the path to perl? It should be set correctly in the CGI configuration but only the system admin would know that. It may not be defaulting to the right location so you maybe need to make the first line of the script something like:

    #!/usr/bin/perl

    The problem you would have is determining the correct path to perl. In any case the error you are getting is from the server not perl. That is where you need to concentrate your efforts.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0
    I'm sorry I'm limping along with your instruction, but I have a hard time understanding...

    So what I should do is call hostway and ask them how the cgi-bin is configured?

    is there anything else I should ask them?

    Sidenote: when I click on the submit button this is the address that appears in the address bar along with the "internal Server Error" message.

    h t t p : / / w w w . a s e t c o r p . c o m / c g i - b i n / F o r m M a i l . p l

    That's right isn't it?
  20. #11
  21. www guy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Location
    Columbus, Indiana
    Posts
    232
    Rep Power
    143
    Just a suggestion.. try running a very simple script to make sure you're configured right. If the simple script runs, you know to look into the Perl code of the FormMail instead:

    Perl Code:
    #!/usr/bin/perl
     
    use CGI::Carp qw/fatalsToBrowser/;
    use strict;
    print "Content-type: text/html\n\n";
     
    print qq|My script is working!\n|;



    If your user interface has a Perl editor, use it! The line break character on a server script is very important, so something edited on a Mac is not going to run. If you don't have a Perl editor interface on the server, download something that will save your document with *nix line breaks for you.. like DZSoft Perl editor.

    Make sure you set the permissions on the Perl file to 755 or higher.

    After you got the script uploaded, go straight to it from a browser.. ex: YourURL/cgi-bin/test.pl
    print qq|Here I am\n| unless -e 'mySocialLife';
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0
    On a Mac can I use BBEdit to write that or do I need a stand alone program?
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0
    also I spent about an hour on the phone with support and none of them knew what I was talking about??? They said that the probelm was on my side and that I needed to have a recipient in the coding of the HTML as well as the FormMail.pl file

    That doesn't make sense right?

    I told him that the action= command tells the HTML to refer to the FormMail.pl file for a recipient.

    Now if that's true, I have no clue? but, in what little I have learned in the last few days is that when I click the submit button on the contact form, it redirects to a new page where I'm getting the "internal server error" therefore the HTML part should be working correctly right?

    Well that was my assumption and I told him that it was their FormMail.pl script that they were providing through their hosting package, so that should be correct as well...

    It seems that when the page redirects to "h t t p : / / w w w . a s e t c o r p . c o m / c g i - b i n / F o r m M a i l . p l" that the perl script should take over from there right?

    They confirmed that the file was in the correct directory as well.

    So this leaves me with no idea where to look.

    I will try the practice script as you provided above as soon as I figure out what to use to write it.

    I really really do appriciate all of your help! I'm learning a lot and I'm gaining some great respect for all of your knowledge!

    Thanks again!
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    10
    Rep Power
    0
    Ok so after long trials I'm having some small break through... I wrote a test.pl just as you suggested to see if the CGI worked and i didn't, but I host with two separate companies and decided to try it on "ipowerweb" instead of "hostway" which isn't working...

    When I tried it on on "ipowerweb" my scripts and forms ran without a problem?

    So this means its a server side error right?

    What would I have to tell the admin at host way in order to fix this?
  28. #15
  29. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,274
    Rep Power
    0
    http://help.hostway.com.au/documents/faq_cgiscripts.htm
    Looks like CGI is supported, but check the paths. The path changes depending on if they provided you with a Windows or Unix server.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo