You are invited to Log in or Register a free Frihost Account!

Forms Processing

I'm pretty much a web hosting noobi and could use a little help getting started.

My web site (not hosted yet) has a simple form. When a website visitor completes the form, I want the contents emailed to me. I know this is not rocket science, but I have some questions. I plan to host my website on FriHost.

1. What exactly is CGI-BIN? I think this is really some kind of (gateway?) interface but some refer it to a programing language.

2. I only do simple HTML and a little Java Script using Dreamweaver 3. To do forms, is CGI-BIN the easiest (only?) route to go?

3. I also hear about "CGI Scripts". Are there 'standard' ones for processing forms?

4. Which scripts, if any, are on FriHost servers.

5. Where are the scripts located and how do I refer to them.

6. Which of these is the easiest to use for forms?

Thanks in advance for any help. Rolling Eyes
If you want some basic information (text) sent to your email then you can use PHP very easily. Just create the mail body with a variable then send in with mail();. If you are unsure how to do that either post back here or in the PHP support forums here on Frihost.

There are also many websites on the internet that you can browse to and find even more information.
cgi-bin is a directory where you can put scripts. The language in which the script is written can vary a lot. On a windows server you'd be able to put dos-batch files in, and on most servers you could put Ruby, Perl or Python in. The advantage of cgi-bin is that you can use these languages for your website.

The easiest way to mail you the contents of a form would indeed be PHP. I don't know what the form would look like, but you could use something like this:

the form:
FORM action="mail.php" method="post">
    <LABEL for="firstname">First name: </LABEL>
              <INPUT type="text" name="firstname" id="firstname"><BR>
    <LABEL for="lastname">Last name: </LABEL>
              <INPUT type="text" name="lastname" id="lastname"><BR>
    <LABEL for="email">email: </LABEL>
              <INPUT type="text" name="email" id="email"><BR>
    <INPUT type="radio" name="sex" value="Mr."> Male<BR>
    <INPUT type="radio" name="sex" value="Mrs"> Female<BR>
    <TEXTAREA name="thetext" id="thetext" rows="20" cols="80">
    <INPUT type="submit" value="Send"> <INPUT type="reset">

the mail.php (you can rename it if you want, but don't forget to change the action in the form):

$message = <<<TEXT
{$_POST['sex']}{$_POST['firstname']}{$_POST['lastname']} wrote you the following message:

If you want to reply, you can mail {$_POST['firstname']} back at the following address: {$_POST['firstname']}
mail('', 'Mail from my form', $message);
Thanks guys,

I took your lead and went with some PHP code for my form. Yes, it;s pretty easy and I had it working flawlessly in much less time than it took me using CGI mailto scripts.

Great forum! Wink
Related topics
How Spyware Works!!!
20 Frih$
How To : Secure Your PHP Website
Image Processing in C++ by Shirish
batch processing softwares for webpages construction
basic tutorials on most forms of web programming
"Forms To Go" create scripts in PHP, ASP and Perl
Easily create forms and many other stuff without much knowle
The 5 Golden Rules of Professional Design
Multiple Forms
Anyone that can give me help/suggestions for forms?
Building Web Forms In Flash
PHP Forms security
PHP Form Processing Problem
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

© 2005-2011 Frihost, forums powered by phpBB.