Canadian Webhosting Forums Forum Index Canadian Webhosting Forums
Discussion Forums
 
 FAQFAQ   SearchSearch      RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Email Form for web page

 
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> CGI
Author Message
Cricket



Joined: 25 Nov 2005
Posts: 6

PostPosted: Fri Nov 25, 2005 7:49 am    Post subject: Email Form for web page Reply with quote

I'd like to put a form on our website that users can fill in to get more information. Something very simple: their email, their question.

I tried to use the one from CPanel, and got stuck. cgiemail is now installed in the cgi-bin directory, but I've no idea how to use it. The FAQ points to a tutorial for FormMail, which says configuring it is easy and then loses me. (Change the perl script?)

As I understand it, I have to do the following:

1. Install a cgi program on the server. (I think that's done, thanks to my experiments with CPanel, but I've no clue how it's configured or how to check. There is definitely a file named www.mydomain.ca/cgi-bin/cgiemail , but I'm not even sure if this is the program the tutoiral is for.)

2. Put something like the following in my html code:

<FORM method=POST action="http://www.mydomain.ca/cgi-bin/cgiemail">
Your email:
<BR>
<input type="text" name="email" size="40">
<BR>
Your question:
<BR>
<textarea cols="50" rows="15" name="question">
</textarea>
<BR>
<input type="submit" value="Send">
</FORM>

3. The user fills in the form, hits "Send", and I will get an email with his email and question.


So:

a) How do I tell the cgi where to send the question? (webmaster@mydomain.ca)

b) Will the cgi tell the user they've done it right? (I just hate clicking a button and not knowing if it worked.)

Thanks in advance!
Back to top
kevin
CWH Staff


Joined: 13 Dec 2004
Posts: 209
Location: Vancouver, BC

PostPosted: Mon Jan 09, 2006 2:32 pm    Post subject: Reply with quote

Hi,

There two form to email scripts in the control panel.

CGI EMail
FormMail Clone

Found under the "CGI Center".

The paths are:

http://www.domain.com/cgi-bin/cgiemail
http://www.domain.com/cgi-sys/FormMail.cgi

It's easier to configure FormMail.
Put this in your forms page:


<form method="POST" action="http://www.domain.com/cgi-sys/FormMail.pl">
<input type=hidden name="recipient" value="yourname@domain.com">

<p>Subject <input type="text" name="subject"><br>
Name <input type="text" name="realname"><br>
Your Comments <input type="text" name="comments"><br>
<br>
<br>
<br>
<input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="Reset"></p>
</form>

Replace domain.com with your actual domain name
and yourname@domain.com with your email address.

More information at:

http://www.scriptarchive.com/readme/formmail.html

-----------
For cgiemail:

Create a file such as template.txt with the following:

From: [email]
To: youremail@domain.com
Subject: questions three

What is your name? [yourname]
What is your quest? [quest]
What is your favourite colour? [colour]

Replace youremail@domain.com with your actual email address.

Upload this file to public_html directory.

Create html forms file, put the following code and upload to public_html:


<form method="POST" action="http://www.domain.com/cgi-bin/cgiemail/template.txt">

Your e-mail address: <INPUT NAME="email"><p>
Your name: <INPUT NAME="yourname"><p>
Your quest: <INPUT NAME="quest"><p>
Your favourite colour: <INPUT NAME="colour"><p>

<br>
<br>
<br>
<input type="submit" value="Submit" name="Submit"><input type="reset" value="Reset" name="Reset"></p>
</form>

Replace domain.com with your actual domain name.

--------------
The big difference between the two is the creation of a template file for cgiemail and FormMail will only send email results to the domain name hosted under Cpanel while cgiemail can be sent to external one.
Back to top
Cricket



Joined: 25 Nov 2005
Posts: 6

PostPosted: Mon Jan 09, 2006 6:03 pm    Post subject: Reply with quote

Aha!

That explains the problem. I was combining the instructions for two different methods (and I suspect the other sites I looked at added a third and fourth). I eventually got the cgiemail method working, but I'll use FormMail for the next one.

Thanks for the clarification, and I suggest the clarification be coppied to the FAQ.

Sandy
kpsweb@kortrightplayschool.ca
sandy@onebit.ca
Back to top
kevin
CWH Staff


Joined: 13 Dec 2004
Posts: 209
Location: Vancouver, BC

PostPosted: Thu Jan 12, 2006 12:25 pm    Post subject: Reply with quote

It has been added!

Cheers
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Canadian Webhosting Forums Forum Index -> CGI All times are GMT - 8 Hours
Page 1 of 1

 


Hosting Plans :: Flash Tutorials :: Contact Us :: Privacy Policy


Powered by phpBB, MySQL and PHP