The program
"COPTHIS.CGI" was written (and ©) by Ron F
Woolley, Melbourne Australia. Copyright 1998 and 1999. This
script can be altered for personal use, EXCEPT THAT:
ALL COPYRIGHT NOTICES must remain in the code, and visible on all output pages,
AND ALL of the header notices MUST REMAIN intact as is,
AND using the script(s) without first reading the README.HTM, is prohibited.
Australian copyright is recognised/supported in over 130 countries
per Berne Convention and other treaties
( including USA! ) no registration required!
The
scripts and associated files remain the property of Ron F Woolley / HostingNet.
NO PROFIT what so ever is to be gained from users for supply of these scripts for the use of
these
scripts,
except that a reasonable minimal charge for installation may be allowed
if
installing
as a site
developer, for a user on the users site that is not on / in the developers domain OR site.
This program must NOT be used for multiple CopThis users on one site/domain
and the program resources must not be supplied as a remote service.
Ron Woolley, the author, MUST be notified via the addresses/URLs
below
if any monetary charge is applied for the installation of these scripts.
NOTE: If you use these
files, you do so entirely at your own risk, and take on full responsibility for the
consequences of using the described files. You must first agree that Ron Woolley /
HostingNet, the only permtted supplier of this and/or accompanying files are exempt from any responsibility for
all or any resulting problems, losses or costs caused by your using these or any
associated files - even if problems are known.
If you disagree
with any of these requirements,
you must immediately destroy all files.
Although this program script is free to
use, if you use it and find it useful, a donation to help continue this support and keep
new scripts / upgrades coming would of course be appreciated.
On line Visa / MasterCard payments are available for donations and low cost installations.
These
files can only be obtained via the above web addresses, and
must not be passed on to others in any form by any means what so ever.
This does not contradict any other statements above - & ensures user obtained the latest.
major update** Version 3.0b, January 21, 2000: **major update
check every few months for upgrades
Like all other dtp-aus.com free programs, CopThis is a fully working program for webmasters, and not a common "play with and plagiarise" free script as found on many sites;
......available / continuously developed for almost 12 months.
History....
1.5
Nov. 2. A minor but far more user friendly change has
been made to the script enabling a new form with entered details
to appear if the user makes a detectable name or e-mail address
mistake. This replaces the previous need to use the Back Button
from an error message.
1.7
$site_url By the addition of a new variable to the
"copitset.pl" 'require' file, the receivers e-mail includes
a reference to a return URL (your site) AND the admin page now
includes a different return URL, $hm_url, for the webmaster. This option was accidentally
left out of earlier versions, and $hm_url will need to be changed for previous installations.
1.7
$msgfile By the addition of another new variable
to the "copitset.pl" 'require' file, and additions to
the script, the webmaster can now customise the body message
of the e-mail sent to the receiving address. Both new variables
in CopThis v1.7 can be easily added to the "copitset.pl"
'require' file of users of v1.5, and will then only need the
up loading (overwrite) of the new script and an additional file
in the "copit" directory - "msg.t".
1.71
Minor enhancements to admin pages and the text preview (preview
text did not wrap).
1.72
Enhancements to admin pages improving readability, and compensating for
problems caused by Netscape 4.5.
1.73/4 Addition of the return page option plus minor visual response-pages enhancements. For users upgrading, the two config files have been renamed to copitset.pl and gmtset.pl. The admin file was renamed admin.pl. Existing forms and logs will not be affected.
Upgrade Notices
NEW as of v2.0 With the addition of one hidden tag, CopThis can now be used with forms containing up to 10 "Friends Address" boxes for multiple sibmissions.
For users upgrading, replace the main program file "copthis.cgi" and the admin require file "admin.pl". NOTE The counter file now receives two values, one for the submission count and the other for the number of addresses mailed to. Upgrading will require the repeat of the current count total figure after the current number - divided by the ":" full colon character (ie "478:478" - see supplied count file). This will then give an accurate value in admin, as prior usage was only for single addresses. ALSO, the "sender" and "friends" input boxes now follow a different naming convention.
v2.0c allows individual return URLs included in the response mails - set in each form, see below.
Upgrading to v3.0 requires major changes / additions to the config file also.
Success page avoidance, users additional message option, javascript "close" notice for pop-ups, up to 15 friends addresses (from 10), error page colour config etc are all new to v3; you should re-read this page.
v3.0a Only days after release - extra control of the "users additional message" box and mail text.
v3.0b Only days after v3.0a!! - now test forms; use the config default e-mail address as the users address AND the "access" password as the users Name - this avoids counting and repeat-checking.
All variables values / names in the config file changed for v3 are marked in the details below!
Low cost installations can be carried out by the author; see program page for details link.
This program is written to be compiled by Perl versions 5+ on Unix servers
ABOUT
So, you have installed a few of wally's and harry's free scripts and reckon readme pages are a waste of time; you know all about it and even know the importance of a referrers check and a "bad referrer" error. Well 99% of all problems are covered / answered by this page and questions to us show many just do not read it. "RTBM" If you can't be bothered to read this page then you are on your own. There is also an informative help/advice page at dtp-aus.com!
Firstly, a few explanations. CopThis
is designed to help you increase visits to your site by making
available to your visitors, a quick and simple way for them to
send a pre-configured but personalised e-mail to their friends.
You have the best chance of having them do this when their enthusiasm
is fresh in their minds direct from your site - by convincing
them that their information is secure, and this form is readily
available (suggested on many pages). Unless you want your site
black listed very quickly, every attempt should be made to protect
your visitors private details.
Don't expect hundreds of submissions a day! Even one now and then can be as good as a whisper in a pub spreading out to a chain of other people.
The sample HTML forms supplied in
the .zip file can be used as is and only requires you to replace
the form action path with your own; ie replace "yourdomain.name"
with your own domain name path. Except perhaps for the addition
of colour, the forms can then be copied and pasted directly into
your existing pages.
Multiple Friends Addresses and Auto Form Regeneration
Although allowing up to 15 "friends" input box pairs in each form (and form independant), CopThis retains the popular "auto" regeneration of an input form when input errors are detected.
Visitor Added Message
IF you want to use the very risky option of allowing visitors to add their own message to the default text, version 3.0 introduces this option by you simply adding a "textarea" box to the form(s). Using a special textarea box "name" value, the program will recognise it IF the box contains text, and handles it appropriatly..... and also:
The "users additional message" text is checked for long words (idiot repeat-key catching).
Either the "users additional message" text is chopped in to multiple lines where applicable (recommended to support all e-mail programs), OR left as input; the regenerated (if errors) additional text box is then set to wrapping "Virtual" or "Off"
depending on the option setup (via admin).
Bad Word Checking
Because of the new "user added message" option, CopThis now includes bad word checking.
As of version 3 you can now easily control the colour appearence of the internal error response pages to match your site - variables in the config file ( view "colours.htm" ).
As of version 3 you can avoid the inbuilt "success" or thanks page entirely and return the visitor to the same form OR another page upon submission.
As of version 3 you can replace the default return hyperlink on the "success" page with a comment to "Close This Window" - use when using a form in a Javascript Pop-Up window.
As of versions 2.0+ of CopThis, you could include up to 10 "friends" (now 15) address and name box pairs for multiple address submissions from each form (to keep the program versatile, each form on your site can have different numbers of "friends" input boxes!). To enable this after designing your form, just add the new hidden tag as explained below in the forms description.
All relevant files are supplied
in one compressed .zip file that includes the recommended directory
structure. It is assumed that the .zip file has been uncompressed
to the root directory of your site pages on your LOCAL PC computer creating
the default directory structure included in the .zip file. Then
you can easily FTP the configured files to your site.
You MUST alter all reference to "yourdomain.name"
in the "copitset.pl" 'require' file - the config file - and sample form,
and change the configuration variables, as described in this
Readme text.
Inbuilt ADMIN Page
The script has an in-built administration
page for; changing your desired GMT time zone, admin page access
password, a further encrypted password authorising admin changes,
plus the deletion or addition of rejected sender IP# or recipient
e-mail addresses. This important feature is included to allow
the exclusion of nuisance visitors that abuse the form, or exclude
addresses of people that have received nuisance e-mail and have
requested that you exclude them in the future.
Usage Totals
The admin page displays the usage totals too; submission totals and address totals. Also as of v3 the totals will be listed by page name - switch on / off via the config file at set up.
Webmaster Testing
Once installed (and thereafter) all forms can be checked without adding to the usage totals plus avoid the repeat-address checking block.
Access to the
Admin page is via your form(s) by entering the required access password
instead of an e-mail address in any form, and an encrypted password protects
you from unauthorised attempts to edit defaults; should the admin
page be found in your browser history cache etc. There is also a supplied webmasters page that can be used for admin access and other private links.
The admin page also allows you
to customise the message body text
sent to the users "friend" if the default text is unsuitable
for your site. There are three Template Field markers included
that will be recognised and replaced with form variables. When
you open the admin page you will see the default text with the
markers in place. Place these markers in your new text (must
be exact copies) wherever they will make sense. When the text
is saved and the admin page refreshed, you can see the effect
of your changes in a preview panel.
When customising the message, consider
the width of each line. Many e-mail programs display e-mail in
a small window and I have seen comments by people that appreciate
narrow formatted texts because of it. The text entry box for
the message is 62 characters wide, so hitting the return key
at word endings close to the edge will help you keep things tidy
(also considering the variable lengths of the senders e-mail
address). A double enter-key entry will give you paragraph spacing.
There are three additional require
files included. One is for script output configuration, and another
is for setting up your local GMT time zone (gmtset.pl). This and
all my scripts will share and look for gmtset.pl in a sub directory
named "sets". The configuration file for CopThis, "copitset.pl",
should also be in this directory. Auxiliary files and the Admin
Password file will be looked for in a subdirectory named "copit".
The third 'require' file loads subroutines.
The cgi-bin directory and any subdirectories
of it should be protected from user access by system default,
so they are an ideal place for maximum security (nothing can
be done if the server is hacked into). Scripts can access
info files, but files cannot be accessed from outside.
Please NOTE: |
If you install and use this script, please contact us at copthisreport@dtp-aus.com with server
type detailsand how the script installed and worked etc,
for a report base assisting others.
( a vote at cgi.resourceindex.com - via red form on the CopThis program page - or any other cgi links site would also be appreciated to help "spread the word" )
Thank you.
|
MENU
For INTERMEDIATE installation experience - Help / Advice information is available.
CONFIGURATION VARIABLES in DETAIL
INCLUDED or REQUIRED FILES
The Perl language allows
the inclusion of extra files containing libraries of commonly
accessed sub routines or common lists of script variables etc.
The script copthis.cgi "require"s three such files.
One includes a variable used by the date/time routines and another
contains script variables that you need to adjust before installation.
Both of these require files are also accessed by the admin page.
In case you use a few more of my scripts, I have included the
GMT reference variable in a separate file - used by all scripts.
If I need to change this common variable, then I only have to
change one file, not many.
THE PATH TO PERL
At the top of each script
(and must remain as the first line) is a default path to the
Perl program on your host server. This does vary between
UNIX servers. If you have problems running the scripts, check
with your host support staff about the correct path described
in this line. The default entry is "#!/usr/bin/perl" and another common variation is "#!/usr/local/bin/perl". In Perl scripts the hash sign "#"
character comments out the code on a line starting with this
character. Here it has a special meaning to Perl and MUST
remain. Check with other installed scripts also if you do not
know what this line should look like.
Even if you have installed other CGI programs you are not necessarily an experienced cgi installer. Because a path worked on another program does not mean it is v5+ (5.003+ preferred)!
The scripts help page (URL above) contains helpful advice; if you are humble enough to learn!
GMT TIME ZONE reference $gmtPlusMinus - 'gmtset.pl'
This value can be set in the admin page - use your PCs "clock setup" for GMT refernce.
Like www.dtp-aus.com, Hosting
services are being used now that are "remote" from
ones local ISP service. Normally this means that all of our scripts
etc report dates and times different to that of our local access
points, ie our home locality from where we view our sites. To
overcome this I use a Perl facility that allows us to use (G)reenwich
(M)ean (T)ime with an offset reference reporting in my local
time and date. One of the perl "Include" files, 'gmtset.pl',
contains a variable name $gmtPlusMinus, whose value MUST be set for your local
GMT offset. I live in a world time zone 15 hours ahead of that
of my Host Servers. Therefore, when I set the variable to 36000
(GMT+10hrs), the lists record, and I view, all dates and times
relevant to my locality irrespective of where my Hosting service
is. With this method I can move my Domain and the results would
not change.
The calculation is simple. Your
local GMT time, multiplied by 60, and multiplied by 60 again.
ie 10X60X60. Therefore my variable entry is "$gmtPlusMinus = 36000". If your GMT zone is a negative value,
simply include a negative value ie "$gmtPlusMinus
= -36000". If you want
the dates/times to be the same as the servers, simply enter the
value for the servers GMT zone.
US AND BRITISH DATE reporting $dtUS
CopThis can save personalise
e-mail submission time using either the US mm/dd/yyyy format,
or the BRITISH dd/mm/yyyy format. In the configuration file,
' copitset.pl ', you will find a variable named $dtUS. Leaving this variable value as null, ie
$dtUS = "" will cause the scripts to use "dd/mm/yyyy".
Setting this variable to $dtUS
= "1" will force 'mm/dd/yyyy'.
@referers array - also a first level security block against site hackers!!
CHECKING FOR CORRECT REFERRERS- " Bad referrer, access denied!"
This security measure tricks many not experienced with installations of subtantial CGI programs.
This option in the 'copitset.pl
' file allows you create an "array" of Domain names
and IP numbers that copthis.cgi will respond positively to. By
including the acceptable calls to your pages and/or your IP#,
ie 'www.yourdomain.com' AND yourdomain.com' you effectively
stop improper additions to your lists from distant sites (entries
are only accepted from your site, not remote copies of your pages
elsewhere they try all the time). The array is
named "@referers" and you simply (MUST) enter your
preferences in place of the examples. NOTE: The brackets,
quotes and commas enclosing each item must be included else an
error will occur, ie:
NOTE: Even YOUR browser command line AND a copy of your page on YOUR home computer will be blocked by referrer checking. ONLY use links / forms ON your site. MENU
|
('www.yourdomain.com','yourdomain.com','000.000.000.000',).
Leave out the IP# if you do not have a true domain name with
a static IP#. 'www.ahost.net/mysite/' etc will also work for
second level site calls etc. MULTI DOMAINS pointing to one? - just add another "pair" to this array as above!
At this point I will bring your
attention to the semi colons ( ; ) appearing at
the end of each line in the config files. These MUST remain else
an error will occur.
PATHS TO FILES ACCESSED BY SCRIPTS
The defaults used in the
'copitset.pl ' file assume you will place these files in your cgi-bin
and add directories to it called "sets" and "copit".
If you have to use other directory names, or your "cgi-bin"
has a different name, then you will have to change the paths
accordingly; "cgi-yourdomain" is not uncommon. There
are three path types that can be used at various times with in
a program or script. A full URL is the same as the path you enter
in your browsers address box when typing in a site path that
you wish to go to: ie 'http://www.wooz.com/harry.htm'.
A relative path is a path description to a source, relative to
the directory of the program, file or web page that is calling
it: ie "jimbo.htm" means that the file being called
should be in the same directory. "inone/jimbo.htm"
refers to a file that should be in a directory named 'inone'
which is a subdirectory within the current directory, and "../jimbo.htm"
means that the file should be in a directory one above the current
directory, and "../../jimbo.htm" is in a directory
two above etc.
For some servers, a simple relative
path called by a script is unacceptable, so a path relative to
the sites root directory must be called. There are also variations
to this description but "web/yourdomain/yourdirectory/jimbo.htm"
(example only) is a relative root path description that works
on many servers. Another root path is "/home/yourdomain/www/yourdirectory/jimbo.htm".
If you have trouble with accessing the default simple relative
paths included in the ' copitset.pl ' file, try the root reference
ie "web/yourdomain/cgi-bin/counters/history.t" etc.
If this is still a problem, look in any installed scripts on
your server for a reference, or contact your hosting support
staff.
NOTE:
If you have problems, double check ALL permission's (below) before
changing the default paths, unless you know in advance what the
paths should be.
MAIL PROGRAM server path - to "SENDMAIL"
Similar to the Perl program
path, this path has to be known for CopThis to send submission
notifications. If you do not know what it is or cannot find reference
to in other installed scripts, ask your Host service support
staff. The default is $mailprog
= "/usr/sbin/sendmail"
GMT Path $gmt_pth - changed v3
When you edit the GMT zone value from the admin page, the script
needs to know the path to the gmtset.pl file. The default is the
"sets" sub directory and file name relative to the
scripts directory.
CONFIGURATION Path $cnfg_pth - changed v3
When you edit the configuration values from the admin page, the
script needs to know the path to the "copitset.pl" config file. The default
is the "sets" sub directory and file name relative
to the scripts directory.
AUXILLIARY FILES Path $dat_dir - NEW v3
The program needs to know the path
to all auxilliary files.
The default is '$dat_dir = "copit/";' a sub directory relative
to the scripts cgi-bin directory. KEEP the forward slash "/" at the end of this name.
REQUIRED ADMIN FILE Path $admn_fle - changed v3
When you load the admin page, the script needs to know the nmae of a 'require' file for admin subroutines. The default is '$admn_fle = "admin.pl";' a sub directory and file name relative
to the scripts cgi-bin directory.
ADMIN Password $pword_file - changed v3
The file name of the file that will be created when
you create an Admin Password. DO NOT edit this file the
new password will be encrypted. When you first access admin
successfully from a form using the Access Password, create a
new Admin password immediately to secure your data from visitors.
The current password will be nothing (null) and you enter the
new word twice to be sure. Once accepted you have to enter the
admin password in the editing forms next to the submit buttons
whenever you try to edit any options. The supplied file includes
a notice. This file must be up-loaded via FTP including the notice
line. (if your server allows scripts to create files, copthis.cgi
will attempt to make this file and add the message line
only if the file is missing).
REPEAT LOCKOUT FILE $repeatfile - changed v3
This is the file name of a list created when visitors send an
e-mail. The script checks each submission to see whether the
same recipient address has been used within the last 48 hours
(default), and if so, refuses to send the e-mail again until
the time has elapsed.
REJECT FILE $rjctfile - changed v3
This is a file name. Should you receive complaints about persons repeatedly abusing
the form, you can permanently block them via their IP#, or block
submissions to complaining recipients. The recipient receives
a record of each senders IP# in the e-mail, so if you get a complaint,
ask them for a copy of the mail received.
COUNT FILE $countfile - changed v3
This is a file name. CopThis keeps a count record of the number of times it is used.
This could be of some interest to webmasters and the current
count is displayed when ever the Admin page is accessed.
V2.0+... The counter now receives two values, the second being the total number of addresses mailed to. This accomodates the facility allowing up to 15 "friends" address boxes.
CUSTOMISED MESSAGE FILE $msgfile- changed v3
This is the name of a text file the admin page will display in
a text area box, allowing customising of the body text sent to
the "friends". The default file ( "msg.t" ) is included in the .zip
file and should be up loaded to the "copit" sub directory.
VISITORS MESSAGE E-MAIL TEXT WIDTH $addtxt_wid - NEW v3
IF you use the "additional vistors message" text box option on any form, this value has two purposes. 1) it will notify the width of an "additional text box" as it is to appear in the regenerated form when syntax errors are detected, AND
2) any text detected in the "additional text box" on a form will be chopped in to line lengths not longer than this value - this is for pre-formatting e-mail lines; a consideration often overlooked as many e-mail viewing programs wrap text likewise and create quite a mess if paragraph lines are not pre-wrapped!
However, changeable via admin this value can be set to a length of zero "0".
a) if set to zero, line length will be ignored AND the "wrap" attribute of the additional text box appearing in the syntax
error regenerated form will be "OFF" (the error form box width will be set to the default variable value - see next variable).
b) if set to any other value (ie 55) then the additional message paragraphs as (2) above and "wrap" attribute of the regenerated error forms additional message box wil be set to "VIRTUAL".
DEFAULT VISITORS MESSAGE E-MAIL WIDTH $addboxDflt_wid - NEW v3
When the paragraph line length option is set to zero ("a" above), this variable supplies the width of the "users additional message" textarea box. Other wise this value is not used.
VISITORS MESSAGE TEXT MAXIMUM LENGTH $addtxt_max - NEW v3
IF you use the "additional vistors message" text box option on any form, this value will be used to check that the user has not entered too much text; OR even attempted to send several large pages of text! It is suggested a simple note referring to this max value is included on the form(s).
CHECKING FOR BAD WORDS - WHOLE or PART $badword_all - NEW v3
Input names and the additional text box option (if used) are checked against the @low_lifes bad word array at the bottom of the 'copitset.pl' config file.
value =1; all characters matching each word in the array are replaced and the form regenerated,
value = 0;
only character matches at the start and end of words (including a complete word) are replaced and force the regenerated form.
LOGGING USAGE COUNTS BY PAGE NAME $logpage - NEW v3
As well as keeping a total count of submissions to the program and how many addresses were sent (viewed in admin), you can set the program to log these totals ALSO by page name (and viewed in a list on the admin page). NOTE: if a page name appears as "default" (ie a short URL is used to access the directory without a page name) then these are usually "index.htm" or "main.htm" etc pages as auto displayed by the server... a directories default page!!)
ERROR PAGE COLOURS - NEW v3
These variables allow you to change the appearence of the error pages. Most sites are happy with the deafult but if you really want to then there is a sample page supplied that will help match which colours to what objects. The variable names are:
$body,$fntcol2,$fntcol3,$fntcol4,$celbg1,$celbg2,$celbg3,$celbg4
Once you have a form working correctly use the "colours.htm" sample for reference.
SITE NAME $siteis
The e-mails sent, and the Admin page, display the name of your
site. Do not make a story of it, just a simple descriptive name
will do.
REPEAT LOCKOUT Time $lokout
Not only worthwhile for trapping mistakes, but this option also
stops people from mass mailing (nuisance) to any one address.
The default in the 'copitset.pl' file is 48 (hours).
Webmasters RETURN PAGE URL $hm_url
The value for this variable in the 'copitset.pl' file needs to
be altered to include the FULL URL Path to your webmasters page
or equivalent. This URL is included as a hyperlink in the admin
page.
PREFERRED RESPONSE URL $site_url
The value for this variable in the 'copitset.pl ' file needs to
be altered to include the FULL URL Path to your home page or
any page that you wish recipients of the message e-mail to come
to if they need to remember your site address, OR if they were
improperly sent e-mail.
NOTE: this URL can now be overridden by including a hidden tag in each form that replaces this default URL when added to the email messages to friends.
COPTHIS.CGI URL $copitScrpt
The value for this variable in the config file needs to be altered
to include the FULL URL Path to the copthis.cgi script. It is
suggested that the script is placed in your cgi-bin or equivalent.
WEBMASTERS E-MAIL ADDRESS
Used mostly for the confirmation
e-mails, this is the address by which you wish to be contacted
or represented.
NOTE:
The backslash ( \ ) is very important for Perl 5 users.
All string references that include the (@) character must insert
a backslash before that character.
WEBMASTER NOTIFY $wbmstr_notify
If you want to be notified whenever the form is used, set this
variable to a value of "1".
NOTE that even if switched off ("0"), you will be notified if text is sent via the "additional text" box option - this is a logical override.
ACCESS PASSWORD $theword
You can enter an Access Password in the copitset.pl file before
installing the program, or later from the admin page. To display
the admin page, simply enter your access password into the form
entry box for the SENDER instead of an e-mail address. If you
enter the password correctly, the script will recognise it and
the admin page will be generated for you.
BAD WORD ARRAY @low_lifes
A fact of life on the Internet, there are many people who's IQ has not yet reached double figures. If you do use the "users additional comment" text box, the input will be checked for bad word matching. This is not perfect but any new words that do get by can be added to this list. Just make sure that each word is placed within single quotes and separated from the next by a comma.
NOTE that even if the webmasters notification variable is switched off, you will receive a copy from any form allowing a users message AND/IF an extra message is submitted.
MENU
THE FORM
The form does not require
any difficult configuration except for the "action" attribute needed to direct to the program path on your site.....
plus if you want to include a return page link from the final "success" page, add the hidden "rtrn" tag to your form and change the URL to a preferred page you want visitors to return to after submitting the message. Leaving this hidden tag out will result in a simple note to use the "Back Arrow".
OR if you do not want the inbuilt "success" page to appear, use the hidden tag "nothnx" AND NOT the above "rtrn" tag. This will simply return to this page (value=) without any "success" notice.
OR if you use a form in a Javascript pop-up window, use the hidden tag "ispopup" to replace the default return hyperlink with the words "Close Window".
plus to override the config default return or visit URL added to the friends email messages, add the "mailrtrn" hidden tag as below to each form allowing different suggested URLs for each.
Important NOTE: the <<url>> field marker (per admin page) MUST be used in the message text created via admin for the
"mailrtrn" hidden tag to work.
plus V2.0+... A hidden tag is now required to indicate the number of "friends" address and name input box pairs included in each form.
NOTE CopThis generates an error form repeating a visitors inputs when errors are detected. This "num" hidden tag now tells the program how many input boxes to create on the error form (up to 15!!).
plus V3.0+... A NEW input tag is now available to allow the visitor to add their own personal message to the default text (marked in blue in thecode below).
NOTE CopThis generates an error form repeating a visitors inputs when errors are detected. This new "addtxt"option will also appear in the regenerated form only IF text is entered in the first form.
The form below is supplied as a sample
in the .zip file. Add colour etc as desired. Remember:
The input text box names must remain unaltered (upgrades note MAJOR changes prior to v2.0).
This code is supplied as sample "readmeform.htm"
<form align="center"
method="POST" action="http://yourdomain.name/cgi-bin/copthis.cgi">
<input type="hidden" name="num" value="1">
<input type="hidden" name="rtrn" value="FULL URL">
OR
<input type="hidden" name="nothnx" value="FULL URL">
OR
<input type="hidden" name="ispopup" value="1">
<input type="hidden" name="mailrtrn" value="FULL URL">
<table border="0" width="480" cellspacing="0"
cellpadding="2">
<tr>
<td width="100%" valign="top"
align="center" colspan="2"><small>If
you have a friend who could gain from a visit to our site, quickly<br>fill in the boxes below and
send them a personalised e-mail.</small></td>
</tr><tr>
<td width="55%" valign="top"
align="center"><small><b>YOUR E-mail
Address</b></small><br>
<input type="text" name="from"
size="25"></td>
<td width="45%" valign="top"
align="center"><small><b>YOUR Name</b></small><br>
<input type="text" name="name"
size="20"></td>
</tr><tr>
<td width="55%" valign="top"
align="center"><small><b>FRIENDS
E-mail Address </b></small><br>
<input type="text" name="to1"
size="25"></td>
<td width="45%" valign="top"
align="center"><small><b>FRIENDS
Name</b></small><br>
<input type="text" name="tname1"
size="20"></td>
</tr><tr>
<td width="100%" colspan="2" valign="top" align="center">
<small><b>You can also add a personal message</b>; <i>1000 char max</i></small><br>
<textarea name="addtxt" cols="44" rows="5" wrap="VIRTUAL"></textarea></td>
</tr><tr>
<td width="590" colspan="2"
valign="top" align="center">
<input type="submit" value="Send
a Message to my friend" name="send">
<input type="reset" value="clear
form"><small><small><br>This information,
your first names and e-mail addresses, will not be used for<br>any
other purpose, or made available to others for any reason what
so ever.</small></small></td>
</tr>
</table>
</form>
There are prepared HTML versions
of this form and others in the .zip file (form(#).htm).
Sample "form3.htm" indicates the easy naming conventions for
multiple "friends" input boxes -
ie;
"to1" and "tname1",
"to2" and "tname2",
"to3" and "tname3", etc..
MENU
INSTALLING
SCRIPT and FILES PERMISSIONS
Each list file must be given
read and write permissions (chmod 766). The directory that they
are placed in will also have to have read and write permissions.
Either read and write chmod 766 (r+w) or possibly chmod 777 (r+w+x)
will work - try the first before the latter. The "sets"
directory and the ?.set files in it must also be given the same
permissions as the "copit" directory and files.
UP LOADING FILES (Posting)
The script must be given
read and execute permissions (r+x).
CGI-BIN permissions are set by the server and no attempt should
be made to change them. Should you have to use another directory,
AND your server allows the execution of Perl CGI scripts in other
directories, then that directory should be set with read and
execute permissions - chmod 755 (r+x).
By far the biggest problems faced
when installing scripts are firstly the file transport encoding
used and secondly the permissions settings set for both files
and new directories. Bitmap images must be sent to the server
using the "Binary" protocol. Text files, ie html pages,
CGI SCRIPTS and require files, MUST be sent in "ASCII"
format. Failure to do this will result in a server failing to
recognise and execute the scripts. Although often referred to
as programs, scripts must be compiled before they do anything.
As an example, files with the .EXE extension on programs that
are installed on Wintel machines are pre-compiled binary executable
programs. Perl scripts on the other hand are compiled in memory
by Perl each time before they can be executed. The script (text)
must be in ASCII text format for the interpreter to be able to
read it.
I REPEAT: Up load scripts and text files as "ASCII" files,
images as "Binary".
So, assuming the default directory
structure is used, you will up load into:
- Directory:
- cgi-bin (server)
- copthis.cgi. (chmod 755)
- cgi-bin/sets (chmod 766 or 777)
- copitset.pl, gmtset.pl (chmod 766 or 777)
- cgi-bin/copit (chmod 766 or 777)
- copit.pw, counts.t, history.t,
rejects.t, msg.t, admin.pl (chmod 766 or 777)
If you must use another directory
for the ??.set files, you must also change the path to those
files at the top of the code in copthis.cgi. ie::
#--- Alter these two paths
only, if needed! -----------------#
require "sets/copitset.pl";
require "sets/gmtset.pl";
#--- Do Not make any changes below this line. ---------------#
Webmaster Testing
By entering the default config e-mail address as the users address AND entering the "access" password as the users name, annoying repeat-address checking blocks are avoided plus the usage counts are NOT updated.
Also enter your own address for the "Friend's address" (and a name) and all e-mails will be sent as normal - this is a handy feature when changing and then viewing the wording / appearance of all e-mails. Also see "referrer checking".
MENU
UTILITIES
Webmasters page CopThis should only be accessed via a site link!
There is a webmasters "utility
access" HTML page in the .zip file (webmster.html). If you
do not have a similar page, I suggest you use this one and place
it in a password protected directory. Once you change the short
url to the script (the action path of the form),
it will allow you to enter the access password and open the Admin
Page when ever you need to. You could also add other utility
links to this page. Most dtp-aus.com programs come with this facility and users find it handy to place all such links and admin access forms on one page ( I hardly ever see the pages on this large site because all admin is accessed via one page - password protected ). Also see "referrer checking".
Note you can also access the admin page via entering the config default "Access" password in the users address box of any form.
If you add this page to an open directory,
at least make sure you have a server default page (ie a dummy
index.htm or default.htm etc) in the same directory, AND do not
link it to or from any other page (else search engine robots
will find it). If found by a clever visitor, they might get into
your admin page, but remember you can also apply an encrypted
password to protect the script from any unauthorised editing;
and your "copit" directory SHOULD also be protected
ie cgi-bin/copit. (You have a very unsafe site
if the cgi-bin and its sub directories can be accessed from your
browser)
UTILITY testbin.cgi
I have created a simple utility script that can be placed in your cgi-bin and run from
your browsers command line. This script will, in almost all cases, detect the Perl version
you are using and report its findings. If it reports version 4 as the only default, then you must
ask your Host Service for the correct path to Perl 5 (Always top and FIRST line in all
scripts). CopThis is a Perl 5 script for Unix servers.
This new version of testbin.cgi also attempts to find the path to Sendmail, and allows you to enter the path and test by sending yourself a brief message. To do this you must change the one variable to the full URL to the testbin.cgi program.
So!
Change the program URL variable.
Place "testbin.cgi" in your cgi-bin directory and chmod 755 (7=r+w+x, 5=r+x).
Then run from a browser command line, ie http://www.yourdomain.path/cgi-bin/testbin.cgi
UTILITY makedir.cgi
I have created a simple utility script that can be placed in your cgi-bin and run from your browsers command line. If your server allows directory creation via cgi scripts, then this utility will attempt to create the default (recommended) directories and file names for you, and set the permissions. It is unprotected and there is no guarantee that it will work; try it at your own risk (disclaimer only). It has worked well on many sites.
Try installing and running this script first. It will report success or failure when creating the files/directories and prove the correctness of your Perl Path", plus indicate that the default relative paths will work OK. If the default urls/paths are not used, then you will have to change them first.
To use it, make sure the "Perl Path" at the top of the script is correct. NOTE: the default Dir/File permissions are set to 766. Change these values to 777 ( directories first ) if your site so requires before running the script. If running the script is successful, you only have to FTP your supplied files over the new empty ones. (note: for security reasons, makedir does NOT prepare an empty file for the cgi scripts, you must upload them (as ascii) and set chmod 755 your self).
If it does not work, try changing chmod values to 777 & 0777 ( directories first ) and run again. If you get locked out from created dirs, see the comments on the dtp-aus.com scripts help/advice page.
Once run, delete the file immediately because it has no input protection and could be run again by some low-life wanting to cause mischief
So!
Place "makedir.cgi" in your cgi-bin directory and chmod 755 (7=r+w+x, 5=r+x).
Then run from a browser command line, ie:
http://www.yourdomain.path/cgi-bin/makedir.cgi
Enjoy - & please let me know
how you get on with this script, how/what server type it installed to.
Ron
MENU
|