########################################################### # A Postcard Program # # # # This script is very easy to set-up, even for those # # just starting out with CGI. It shouldn't take longer # # than 10 minutes to get it up and running. It has been # # tested on UNIX & NT and no problems were discovered. # # # # The use of templates make it very easy to customize # # the postcard script to your needs. # # # # MAKE SURE THAT YOU READ OVER THE TERMS OF AGREEMENT # # BEFORE USING THIS SCRIPT. BY USING THIS SCRIPT, # # YOU ARE AGREEING TO ABIDE BY THEM. HOWEVER, IF YOU # # DON'T AGREE WITH IT, THEN DON'T USE MY SCRIPTS. ALSO, # # PLEASE READ THE 'README.TXT' FILE BEFORE INSTALLING. # # KEEP IN MIND THAT JASON'S SCRIPTS & THE AESTHETIC # # SURGERY CENTER SHALL NOT BE HELD LIABLE FOR ANY # # DAMAGES THAT MAY OCCUR FROM DOWNLOADING AND/OR # # INSTALLING MY PROGRAMS. IN SHORT, DOWNLOAD AND USE MY # # PROGRAMS AT YOUR OWN RISK! IF YOU DO NOT AGREE WITH # # THIS, THEN DO NOT USE ANY OF MY PROGRAMS. # # # ########################################################### Instructions 1.) Upload the files to your server & set permissions 2.) Edit the file 'card.cgi'. 3.) Edit the file 'index.html' 4.) Edit the templates ################################################### ################################################### 1.) Upload the files to on your server and set the following permissions.... A.) Upload these files to the folder /postcard/ on your server /postcard/preview.html /postcard/makecard.html /postcard/thankyou.html /postcard/error.html /postcard/email1.txt /postcard/email2.txt /postcard/program.cgi* - chmod 755 /postcard/card.cgi* - chmod 755 *Some hosts make you put your cgi scripts in a separate '/cgi-bin/', if so, please place the script in your cgi-bin, rather than in the /postcard/ folder. But if you can place the script in any folder, than place it within /postcard B.) Create the folders /postcard/cards/ and /postcards/pictures/ and set the permissions on these two folders to 755 or 777. Put your pictures in the folder labeled /postcard/pictures/** **if you plan to use your own photos, please put them in this folder and make sure that they do not end with '_zz.jpg' or '_zz.gif'. For example, 'picture1_zz.jpg' would be bad, 'picture1.jpg' would be okay. The photos that will be uploaded will be stored in this file as well - /postcard/pictures/. ################################################### ################################################### 2.) Change the Following on the file "card.cgi".... A.) These three variables are the URL's of the main postcard file, where the pictures will be kept, and the cgi of the postcard, respectively. These need to be changed according to your server $location = "http://www.yourcompany.com/postcard/"; $basepicurl = "http://www.yourcompany.com/postcard/pictures/"; $cgi = "http://www.yourcompany.com/postcard/card.cgi"; B.) Below are the directories of the template files. Please upload the following files to the folder - http://www.yourcompany.com/postcard/. For UNIX users, the variable '$ENV{DOCUMENT_ROOT}' usually finds the exact path location to the files, so keep it there. It should look like the following.... $cards = "$ENV{DOCUMENT_ROOT}/postcard/cards/"; $basepicdir = "$ENV{DOCUMENT_ROOT}/postcard/pictures/"; $preview1 = "$ENV{DOCUMENT_ROOT}/postcard/preview1.html"; $preview2 = "$ENV{DOCUMENT_ROOT}/postcard/preview2.html"; $makecard = "$ENV{DOCUMENT_ROOT}/postcard/makecard.html"; $thank_you = "$ENV{DOCUMENT_ROOT}/postcard/thankyou.html"; $error = "$ENV{DOCUMENT_ROOT}/postcard/error.html"; $email1 = "$ENV{DOCUMENT_ROOT}/postcard/email1.txt"; $email2 = "$ENV{DOCUMENT_ROOT}/postcard/email2.txt"; For NT users, you will need the full path instead of the variable '$ENV{DOCUMENT_ROOT}'. It should look something like.. $cards = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\cards\\"; $basepicdir = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\pictures\\"; $preview1 = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\preview1.html"; $preview2 = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\preview2.html"; $makecard = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\makecard.html"; $thank_you = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\thankyou.html"; $error = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\error.html"; $email1 = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\email1.txt"; $email2 = "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\email2.txt"; C.) This is location of your email program. For UNIX users, it should look should like the following. The first one is the most commonly recognized variable, while the one below it is the next common. I would suggest trying the first variable and if it doesn't seem to send e-mails, then try the next one. If there is still no e-mail, then ask your hosting provider for the location of the mail program and if it is turned on. $mailprog = '/usr/lib/sendmail'; $mailprog = '/usr/sbin/sendmail'; For NT users, it should look something like the following. I would suggest trying this variable and no such luck, then I would ask your hosting provider for the location of the mail program and if it is turned on. $mailprog = 'windmail'; D.) This is the number of days you want the postcard to remain on the server. $MAX_DAYS = '10'; E.) The following two variables are subject headers of the e-mail's being sent. $subject1 is the subject header of the e-mail being sent to the recipient while $subject2 is the subject header of the e-mail received by the sender when the postcard was picked up by the recipient! $subject1 = "You Have A Postcard!"; $subject2 = "The Postcard was Pickup!"; F.) The following variable is what connects the two CGI Scripts together. This path is very important and must be exactly correct or it will not work. The file labeled "program.cgi" doesn't need to be edited. The reason for the two separate CGI files are for those who want to upgrade to version 2. This way, you just upload the newer version of program.cgi and that's all For UNIX users, you may be able to use the following.. require "$ENV{DOCUMENT_ROOT}/postcard/program.cgi"; For NT users, you need to use the full path, and will look something like.be able to use the following.. require "D:\\inetpub\\wwwroot\\248189\\p6u8yua3\\postcard\\program.cgi"; G.) ############################################################ # For those using the Free version, please disregard # the variables $uploadmax & $allowed. Those using the # upgrade version, please read and change the following two # to meet your needs. ############################################################ This is the maximium size of file that can be uploaded to the server in Kb. I recommend that you set this between 40 - 60, so that people don't upload large pictures that will take up lots of space. $uploadmax = '50'; This is the maximium size of the file '/postcard/pictures/' in Kb. So once the file has exceeded its $allowed, the user can't upload their own picture until the old ones have erased. This script will automatically delete the old pictures as well as the old postcards so you will not have to worry about that! Currently it is set on 1000Kb or 1 megabyte, which is pretty large. I added this because some people have only a certain amount of space available to them. Rememer this space also includes your own pictures that you will upload. If space doesn't matter, set it to a large number. $allowed = '1000'; ################################################### ################################################### 3.) Change the Following on the file "index.html" If you open the file, you should see the following... You need to change the 'http:' part to point to your own server
To add your own pictures, link the 'http://' to the picture in the folder /postcard/pictures your server. Then where you see, VALUE, type in the name of the picture, so if you want to use 'bluefish.jpg', then type in 'bluefish.jpg' for VALUE. it is pretty self-explanatory.
################################################### ################################################### 4.) Editting the template files In changing the template files, you can edit them in any way you want. However, you must not change them around, i.e, leave the %%% before and after the variables or else it will not work. the variables do the following and thus can add them to any of the template files.. %%%PICTURES%%% - URL of the Picture %%%SENDER%%% - The name of the sender %%%MAILFROM%%% - The e-mail of the sender %%%RECIPIENT%%% - The name of the recipient %%%MAILTO%%% - The e-mail of the recipient %%%MESSAGE%%% - The message %%%CGI%%% - The URL of card.cgi %%%MAX_DAYS%%% - The max number of days on the server %%%SHORTDATE%%% - The exact date in the format - MONTH DAY, YEAR at TIME %%%url_of_card%%% - The URL of the postcard that was created ################################################################################# If you have any further questions or comments, please feel free to e-mail. #################################################################################