# Stuff Dat Adder: Created by James Hart # # Stormer Web Designs # # http://stormer.communitech.net # # scripts@stormer.communitech.net # # ============================================== # Credits and Copyright Information: Chase Ventors - The Ultimate Cgi-bin http://www.tucb.com Author of the original "Link Adder Script" This Stuff.dat Adder is a modification of that script. Author's copyright is included in the stuff.cgi. Please leave this intact! It may NOT be packaged with the Dansie Shopping Cart as a "complete" Package for resell. This is a free Script. This script MAY NOT BE SOLD! You may NOT make money from this. You may however link to the page below and allow for people to download. ********************************************************************************************** If you like this script simply link to and download it here: http://stormer.communitech.net/prod05.htm Please note: REGISTRATION IS REQUIRED BEFORE DOWNLOADING THIS SCRIPT. You can find this script in the TUCB section. ********************************************************************************************** Purpose: To allow owners of the Dansie Shopping Cart to easily add inventory to their Cart Database. Files included: 7 files Readme.txt index.htm linktmpl lock.dat stuff.dat stuff.cgi test.htm Instructions: ======================================================== Index.htm Strongly urge and suggest you password this file. (For ultimate security, you can keep this file on your local system and add inventory that way as long as your connected to the internet) Also, be sure to RENAME the "stuffadder.cgi" file! We dont want people adding "stuff" to your inventory do we? You can add categories here. Make sure the Form Action is correct. ======================================================== linktmpl This is the "guts" of the script believe it or not. This is exactly how the index.htm form will write to the stuff.dat file. Play with it. What I suggest, is upload everything you see in this zip (including the stuff.dat) and play with it. You can modify the linktmpl depending on how you are inputing your data. **Clue: there is no limit as to how many $variables you can have in this template file. Example: $price in the linktmpl is where (name=price) is inputed on the index.htm So if you wanted to add extra form parameters, add them on the index.htm and then simply put the same "name" in the linktmpl with a "$" in front of it. Simple huh? ======================================================== lock.dat This file is used in case you are allowing multiple people to input inventory at the same time. This will prevent the file from being written to at the exact same time. If you use this, be sure to enable locking in the stuff.cgi ======================================================== stuff.dat Chmod this 666 (writable) dont touch the ======================================================== stuff.cgi (rename this file or place in a directory somewhere inside your cgi-bin so it cannot be easily located and executed with "another" stuffadder.cgi script!) - SECURITY NOTE Chmod 755 (executable) These are the only variables you need modify in the stuff.cgi: Make sure path to perl is correct. $linetempl = 'linktmpl'; $addfile = 'stuff.dat'; $lockfile = 'lock.dat'; #The dir can be found by looking at the directory in your ws_ftp program!# $dir = '/usr/local/webhome/yourname/cgi-bin'; # Full unix path to the directory where stuff.dat is located. Also the directory where linktmpl and lock.dat are located. $locking = 0; # Set to 1 if more than one person will be adding inventory! $utest = 1; # I have no clue.. dont touch it. It works this way. =) test.htm You can use this to see if what you added is visable with your cart. (besure to add the categories here also!) ======================================================== I urge you to just upload it the way it is. Then play with it. See how it works. LEARN IT. UNDERSTAND THE THEORY BEHIND IT. Heres why I say this.. if you GOOF.. you will have to FTP into your server, download the stuff.dat and manually delete the line you added. =) Sorry no admin section here. What do you expect for free? =) btw.. if someone "does" manage to create an admin section for this, and CAN delete items from the Stuff.dat, please be sure to write and tell me. I will mention you on the download page for this script. kudos! You will be famous! Hope this works for you. Have fun, I offer very little tech support. =) But if you have questions, feel free to post your comments here: http://stormer.communitech.net/disc5_toc.htm James Hart Stormer Web Designs http://stormer.communitech.net scripts@stormer.communitech.net