Email Form for web page

Email Form for web page

Postby Cricket » Fri Nov 25, 2005 8:49 am

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!
Cricket
 
Posts: 10
Joined: Fri Nov 25, 2005 7:29 am

Postby kevin » Mon Jan 09, 2006 3:32 pm

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.
kevin
CWH Staff
 
Posts: 245
Joined: Mon Dec 13, 2004 12:48 pm
Location: Vancouver, BC

Postby Cricket » Mon Jan 09, 2006 7:03 pm

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
Cricket
 
Posts: 10
Joined: Fri Nov 25, 2005 7:29 am

Postby kevin » Thu Jan 12, 2006 1:25 pm

It has been added!

Cheers
kevin
CWH Staff
 
Posts: 245
Joined: Mon Dec 13, 2004 12:48 pm
Location: Vancouver, BC

Re: Email Form for web page

Postby JacobGilpin » Tue Feb 16, 2010 2:51 am

I'm trying to put CGI email on my webpage but when I place the code onto the page it just disappears totally. I'll save the code and then when I check my page it's nowhere to be seen. Could this be a problem with cgi email or is it on my side? Has anyone else had this problem?
Last edited by JacobGilpin on Sun Apr 25, 2010 9:06 am, edited 1 time in total.
JacobGilpin
 
Posts: 1
Joined: Tue Feb 16, 2010 2:47 am

Re: Email Form for web page

Postby Ray » Fri Apr 09, 2010 5:13 am

Jacob,

The details of setting up of CGI email can be seen from the link : http://web.mit.edu/wwwdev/cgiemail/user.html

Regarding the disappearing of the uploaded file, this should be due to the ConfigServer eXploit Scanner (cxs) running in all our shared servers. Active scanning is performed by CXS on all text files uploaded through:

* PHP upload scripts
* Perl upload scripts
* CGI upload scripts
* Any other script type that utilizes the HTML form ENCTYPE multipart/form-data
* Pure-ftpd

CXS might be detecting your uploaded file as suspicious and will be quarantining it. If you feel this issue persists, open up a ticket to support@canadianwebhosting.com with all the required details, logins and steps to re-create the trouble.
Ray
Ray
 
Posts: 20
Joined: Sun Nov 08, 2009 9:25 pm


Return to CGI

Who is online

Users browsing this forum: No registered users and 1 guest