need help with HTML, form + CGI

Hi,

I wan’t to add simple web form to my page. name, e-mail, comment, so I started poking around internet and found out about CGI.

I wanted to know how can I find out if CGI is enable on my server ?
What kind of CGI script I need for this kind of form?
How can I make this work.

Thank you in advance

If you’re using Virtualmin, and you’ve setup a Virtual Server – you’ll certainly be able to do what you need.

One option would be to put a PHP script in the public_html directory, and have it do what you need.

If you’re using a language other than PHP (such as Perl, Python, Ruby, or Bash), you can create the script, and put it into the cgi-bin directory.

-Eric

Actaully I just have access to virtualmin :slight_smile:

I found more information , I put premade cgi.(pearl) script in cgi-bin folder and adjusted form for that script:

When I tested out my form , i got this error:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] 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.
Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.6(2007-09-24) mod_ssl/2.2.8 OpenSSL/0.9.8g Server at rags.lv Port 80

any ideas ?

you cant call such script directly. Normally the webform will have the “action”-part pointed to the script which in its turn will send you an email.

yes,

did you mean like this ?

form action="…/cgi-bin/formmail.pl" method=“post” enctype=“text/plain” name=“atsauksmes” class="contactForm

does it work like this, as I assume the script is only one level up, not 2 ?

It actually is 2 levels up, because whole web site is in folder test, becuse it is not live yet…

public_html/test/