% which sendmail
% whereis sendmail
chmod 755 Feedback.cgior if you renamed it to Feedback.cgi substitute that in for Feedback.cgi above.
NOTE: You will also need to execute the same command for FeedbackAdmin.cgi or FeedbackAdmin.cgi.
chmod 777 feedback.htmlIf you choose to rename your feedback.html file to another name, simply put that in the above command in place of feedback.html.
<input type=hidden name="config_file" value="/home/username/public_html/config.txt">
Once this form field is set inside of your feedback entry form, you can then create your entry form to contain any fields you wish and look however you want. Just make sure if you don't use the pre-made templates that come with the Feedback script, that you learn how to create your own templates in the Using Templates section.
This is so the feedback.cgi program will be able to identify where to start placing the newest entries for your feedback. If your feedback.html file was located in /home/username/public_html/feedback/, this variable would be defined in the config_file as:
$FEEDBACK_FILE = '/home/username/public_html/feedback/feedback.html';
This file must be chmoded 777 so that it can be written to by the web server.
$FEEDBACK_NUM = '/home/username/public_html/feedback/num.txt';
$ENTRY_ORDER = '';
Otherwise, if you wish to have the oldest entries appear at the top and any newer entries at the bottom, simply set your $ENTRY_ORDER variable to:
$ENTRY_ORDER = 'oldest->newest';
@LIMIT_HTML = ('h1','img','blink');
If you want ALL HTML tags users enter in their entries to be removed, simply set @LIMIT_HTML to:
@LIMIT_HTML = ('all');
Or if you don't care what HTML tags your users use, simple set @LIMIT_HTML to:
@LIMIT_HTML = ('');
$BAD_WORD_FILE = '/home/username/public_html/feedback/badwords.txt';
@BAD_WORD_FIELDS = ('comments','feedback');
Otherwise, if this is not defined and $BAD_WORD_FILE is, all fields will be searched for bad words, and you can leave this array as:
@BAD_WORD_FIELDS = ('');
$BAD_WORD_ACTION = 'reject';
If you just want to keep the default way of removing the bad words and posting the entry, leave $BAD_WORD_ACTION undefined:
$BAD_WORD_ACTION = '';
$LAST_LOG_FILE = '/home/username/public_html/feedback/lastlog.txt';
$LAST_LOG_MAX = '5';
Or for a default of 3, leave it at:
$LAST_LOG_MAX = '3';
$BANNED_HOSTS_FILE = '/home/username/public_html/feedback/banhosts.txt'
You should not edit this file by hand as the IP addresses and host names are configured in here in a way that is easy for the script to tell them apart and if you reverse them or do not use the correct separators, the script may not catch the banned user. Instead use the administrative functions to ban a user. The remove, approve and archive functions of the FeedbackAdmin program allow you to ban the user.
The source might look like:
Name: <input type=text name="name" size=30><br>
E-Mail: <input type=text name="email" size=30><br>
URL: <input type=text name="url" size=40><br>
Title: <input type=text name="title" size=40><br>
<input type=hidden name="config_file" value="/path/to/config.txt">
If all you wanted the feedback entry to look like was:
Which has a source of:
<a href="url">title</a><br>
<a href="mailto:email">name</a>
<hr>
Your feedback_entry_template would look something like this:
<a href="<<url>>"><<title>></a><br>
<a href="mailto:<<email>>"><<name>></a>
<hr>
Then if you saved this file as entry.txt in the /home/username/public_html/feedback/ directory, the variable configuration might look like:
$FEEDBACK_ENTRY_TEMPLATE = '/home/username/public_html/feedback/entry.txt';
$SUCCESS_TEMPLATE = '/home/username/public_html/feedback/success.txt';
$ERROR_TEMPLATE = '/home/username/public_html/feedback/error.txt';
$PREVIEW_TEMPLATE = '/home/username/public_html/feedback/preview.txt';
NOTE: In your preview page you MUST reprint the form with hidden fields. The script will not keep track of that for you!!! In other words, if we take the example from $SUCCESS_TEMPLATE, and were to create a preview function out of that, we would place the following line in the original script:
<input type=checkbox name="preview" value="YES"> Preview Entry
Or if you don't want to give users a choice and automatically make them preview:
<input type=hidden name="preview" value="YES">
Then your preview.txt (preview html template) might look similar to:
<html><head><title>Preview Feedback Entry</title></head><br>
<body><center><h1>Preview Feedback Entry</h1></center><p>
Please Preview Your Entry Below. If it is correct, hit the 'Add Entry' button below.<p><hr><p>
<a href="<<url>>"><<title>></a><br>
<a href="mailto:<<email>>"><<name>></a>
<p><hr><p>
<form ...>
<input type=hidden name="name" value="<<name>>"><br>
<input type=hidden name="email" value="<<email>>"><br>
<input type=hidden name="url" value="<<url>>"><br>
<input type=hidden name="title" value="<<title>>"><br>
<input type=hidden name="config_file" value="/path/to/config.txt"><br>
<input type=submit value="Add Entry"><br>
</form>
The above example shows how to recreate the form in hidden fields so that the user doesn't see it, as well as show them a demonstration of what the entry will look like. Make sure you include all of the fields you had in your form in your preview.txt file, except the preview field, as including it would cause the user to see another preview field. :-)
$REDIRECT = 'http://your.host.xxx/~username/feedback/success.html';
@REQUIRED = ('name','email');
If these are not filled in, the script will return an error message, either generic or as specified in $ERROR_TEMPLATE.
Archiving by Month:
$ARCHIVE_TYPE = 'month';
Archiving by Number:
$ARCHIVE_TYPE = 'num';
$ARCHIVE_MONTH_DIR = '/home/username/public_html/feedback/archive/';
NOTE: Since these files will be created automatically by the web server, you must chmod 777 this directory.
$MAX_ENTRIES = '50';
$ARCHIVE_BY_NUM_FILE = '/home/username/public_html/feedback/archive.html';
$MANUAL_ARCHIVE_FILE = '/home/username/public_html/feedback/archive.html';
If this file was located in /home/username/public_html/feedback/reply.txt, your variable would look like:
$REPLY_TEMPLATE = '/home/username/public_html/feedback/reply.txt';
$REPLY_FROM = "John Doe
$REPLY_FROM = "john@doe.com (John Doe)";
or simply:
$REPLY_FROM = "john@doe.com";
This allows the remote user to be able to reply to you.
$reply_to = "Thanks for signing my feedback";
If you were to store your email_template at: /home/username/public_html/feedback/email.txt, set this variable to:
$EMAIL_TEMPLATE = '/home/username/public_html/feedback/email.txt';
$EMAIL_TO = "john@doe.com";
$EMAIL_SUBJECT = "Someone signed the feedback.";
$USE_ADMIN = 'YES';
$PASSWD_FILE = "/path/to/passwd.txt";
$APPROVE_FILE = '/home/username/public_html/feedback/approve.txt';
If you do not want to use the approve function, make sure this variable stays undefined:
$APPROVE_FILE = '';
$ADMIN_CGI_URL = 'http://your.host.xxx/cgi-bin/FeedbackAdmin.cgi';
$ADMIN_URL = 'http://your.host.xxx/~username/feedback/admin.html';
Keep in mind, that with the new template features of the feedback script, there is no reason for you to HAVE to keep the default distribution. You can create your own addition forms and just make the feedback work with them by editing the default entry.txt template.