Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a answer box or feedback box? 2

Status
Not open for further replies.

rock31

Programmer
Jul 18, 2004
38
US
I am making my own homepage. I need to set up a box for others to enter the feedback or comments? How should I do this?

<form> <input type="button" value="Submit" name="B1" onClick="javascript:answer_window('system_answer.html')"> </form>

Now, my question is how to make a system_anser.html>
Thanks alot
 
What does your answer_window function do? Are you asking how to process a feedback form? If you're asking that, html cannot help you. You wil need to employ server side scripting, whichever is available to you.
 
Vragabond is absolutely right, I thought I'd post this to try and help you understand what you need to do to go about getting your feedback setup.

First of all you'll need a host that supports CGI, then follow the instructions below.

You need 3 files for the process to work:
(1) Your HTML page that contains the form (an example of this is mine shown below).

(2) The formmail.cgi/formmail.pl script that takes data from the form and sends it to you in an email.

(3) An HTML page confirming to the visitor that their information has been sent.

It's not easy to write your own formmail script so I recommend going to and downloading the formmail.cgi file. It is a good idea to read the help files that come with this as they will help you to understand what is going on and which bits you need to change.

You will need to edit the text file in a text editor (Notepad will do).
Make sure you have version 1.92 or later as earlier versions are insecure.

You will definitely have to alter:

Code:
@referers = ('mydomain.name','www.mydomain.name');

In this line, you should include all domain names that are going to use this script, usually this is just your website. Make sure you put your actual hosted domain name in here.

Code:
@recipients = &fill_recipients(@referers,'you@yourdomain.com');

In this line ensure you put your e-mail address you are sending the files to.

This file can now be saved and uploaded to your website, make sure you upload the file in ASCII/text mode and NOT in binary mode. Also ensure it has read and execute permissions (755) for user group and all, as well as write permissions for the user.

This is the form part of your html page, I'll try and explain each bit:

Code:
 <form action="[URL unfurl="true"]http://www.yourdomain.com/FormMail.pl"[/URL] method="post">
This tells the form what to do with the entered informaion. Make sure you give it the correct path to your formmail script.

Code:
<input type='hidden' name="recipient" value="you@yourdomain.com"/>
Make sure this is set to the email address ou are sending the data to.

Code:
<input type='hidden' name="subject" value="User Feedback"/>
Change 'User Feedback' to whatever you want the subject of the email you receive to be.

Code:
<input type='hidden' name="required" value="feedback"/>
Put any field names in here that MUST be filled in by the user i.e required fields

Code:
<input type='hidden' name="redirect" value="[URL unfurl="true"]http://www.yourdomain.com/thankyou.html">[/URL]
Change the URL here to where you want the user to be redirected telling them their form has been submitted.

Code:
<span class="text">Feedback :</span><br>
<textarea name="feedback" rows="10" cols="40"></textarea>

<input type="submit" value="Ok">
</form>
This just sets out the form. Make sure you include the Ok button at the bottom or they won't be able submit it =)

Now just put this form where you want it on your page and make your thank you page and upload it all.

Hope this helps - any questions just ask =)
 
[tt]<input type='hidden' name="recipient" value="you@yourdomain.com"/>[/tt]

Make sure this is set to the email address you are sending the data to.
This is an insecure way to set up a formmail script - you're putting your email address in plain view of spammers, and you're also in danger of letting spammers hijack your script by sending it different values for [tt]recipient[/tt].

Any worthwhile formmail script should let you hardcode the recipient address in the script itself, rather than having it passed in as a parameter.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top