Gossamer Forum
Home : Products : DBMan : Installation :

CGI Error

Quote Reply
CGI Error
JPdeni,

Well I got the defalut datbase working just fine. I decided to follow your tutorial on your web page to customize with my datbase. I used the configurer that is linked to your site. Here is the error I recieved and the files that were created.

------------------------


CGI ERROR
==========================================
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: ./products.pl did not return a true value at products.cfg line 53.

Script Location : db.cgi
Perl Version : 5.00503
Setup File : products.cfg

Form Variables
-------------------------------------------
$db_key : *
db : products
view_records : 1

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /home/sites/absolutedesire/public_html/
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION : Keep-Alive
HTTP_COOKIE : shipping_address=name%3A%3AWilliam%2BKarasinskai%26company%3A%3A%26address%3A%3AP.O%2BBox%2B6216%26city%3A%3ASouth%2BLake%2BTahoe%26state%3A %3ACA%26zip%3A%3A96157%26country%3A%3AUSA%26phone%3A%3A530-541-6064%26email%3A%3Abkguru@webtv.net%26name2%3A%3AWilliam%2BKarasinskai%26compa ny2%3A%3A%26address2%3A%3AP.O%2BBox%2B6216%26city2%3A%3ASouth%2BLake%2BTahoe%26state2%3A%3ACA%26zip2%3A%3A96157%26country2%3A%3AUSA%26phone2 %3A%3A530-541-6064%26email2%3A%3Abkguru@webtv.net
HTTP_HOST : www.absolutedesire.com
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
PATH : /usr/local/bin:/usr/bin:/bin
QUERY_STRING : db=products&view_records=1&$db_key=*
REMOTE_ADDR : 24.28.6.155
REMOTE_PORT : 2044
REQUEST_METHOD : GET
REQUEST_URI : /cgi-bin/dbman/db.cgi?db=products&view_records=1&$db_key=*
SCRIPT_FILENAME : /home/sites/absolutedesire/public_html/cgi-bin/dbman/db.cgi
SCRIPT_NAME : /cgi-bin/dbman/db.cgi
SERVER_ADMIN : absolutedesire@absolutedesire.com
SERVER_NAME : www.absolutedesire.com
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Apache/1.3.6 (Unix) FrontPage/4.0.4.3 PHP/3.0.11 mod_perl/1.19
----------------------
Here is the cfg file
# Wait until this file finishes loading and then save it to your hard drive as products.cfg.
#
# After you have saved the file, use the "back" button on your browser to build the next file.
#
# ----------------------
# DBMan
# ----------------------
# Database Administrator
#
# File: products.cfg
# Description: This is the setup file that contains the database definition,
# and most of the options required to set the program up.
# Author: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.04
#
# COPYRIGHT NOTICE:
#
# Copyright 1997 Gossamer Threads Inc. All Rights Reserved.
#
# This program is being distributed as shareware. It may be used and
# modified free of charge for personal, academic, government or non-profit
# use, so long as this copyright notice and the header above remain intact.
# Any commercial use should be registered. Please also send me an email,
# and let me know where you are using this script. By using this program
# you agree to indemnify Gossamer Threads Inc. from any liability.
#
# Selling the code for this program without prior written consent is
# expressly forbidden. Obtain permission before redistributing this
# program over the Internet or in any other medium. In all cases
# copyright and header must remain intact.
#
# Please check the README file for full details on registration.
# =====================================================================
# File and URL's
# --------------------------------------------------------
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://www.absolutedesire.com/cgi-bin/dbman";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/products.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/products.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/products.log";
# Full path and file name of the html routines.
require $db_script_path . "/products.pl";

# Database Definition
# --------------------------------------------------------
# Definition of your database. Format is
# field_name => ['position', 'field_type', 'form-length', 'maxlength', 'not_null', 'default', 'valid_expr']

%db_def = (
'ProductID' => [ 0, 'alpha', -1, 255, 0, '', ''],
'OrderID' => [ 1, 'alpha', -1, 255, 0, '', ''],
'Category' => [ 2, 'alpha', -1, 255, 0, '', ''],
'Subcategory' => [ 3, 'alpha', -1, 255, 0, '', ''],
'Name' => [ 4, 'alpha', 20, 255, 0, '', ''],
'Description' => [ 5, 'alpha', -1, 255, 0, '', ''],
'Image' => [ 6, 'alpha', 20, 255, 0, '', ''],
'Cost' => [ 7, 'numer', -1, 255, 0, '', ''],
'Price' => [ 8, 'numer', 6, 6, 0, '', ''],
'Size' => [ 9, 'alpha', -1, 255, 0, '', ''],
'Color' => [10, 'alpha', -1, 255, 0, '', ''],
'Date' => [11, 'date', -1, 255, 0, '', '']
);

# The column name for the database key. Can be any column, but it must be unique!
# You can't have two records with the same key value!
$db_key = 'ProductID';
# Track the key? Should DBMan keep a counter of the next key to use? This isn't
# neccessary if you can guarantee that your entry in the key field will be unique
# (i.e. a userid).
$db_key_track = 0;
# Database delimeter.
$db_delim = '|';
# Use file locking (1 = Yes, 0 = No). Should be used, but won't work on Win95.
$db_use_flock = 1;
# Auto generate the html forms (1 = Yes, 0 = No).
$db_auto_generate = 0;
# Display Benchmarking Information (1 = Yes, 0 = No).
# use Benchmark; # Uncomment this line if benchmarking is used.
$db_benchmark = 0;
# Display Debugging Information (1 = Yes, 0 = No).
$db_debug = 0;

# Select fields. Field name => 'comma seperated list of drop down options'.
%db_select_fields = (

);

# Radio fields. Field name => comma seperated list of radio buttons.
%db_radio_fields = (

);

# Checkbox fields. Field name => Checkbox value.
%db_checkbox_fields = (

);

# Default maximum number of hits returned in a search.
$db_max_hits = 20;
# Bold search results (1 = Yes, 0 = No).
$db_bold = 1;
# Regular and title fonts used in auto_generation and html.pl.
$font = 'font face="verdana,arial,helvetica" size="2"';
$font_title = 'font face="verdana,arial,helvetica" size="4"';

# Authorization Options
# --------------------------------------------------------
# No Authentication? (1 = "there is no authentication", 0 = "there is authentication")
# If you choose no authentication, then set the permissions of what
# people can do with: @auth_default_permissions below.
$auth_no_authentication = 0;

# The amount of time in seconds that user files are kept in the
# auth directory before the program removes them. 2-6 hours is
# probably a good value.
$auth_time = 21600; # 6 hours (in seconds)

# Enable (1) or disable (0) logging.
$auth_logging = 1;

# Allow a default user? This means you can specify a user via the URL
# and skip the logon process. Use this to allow people to search without
# logging on, but require log in if they want to add/modify/remove etc.
# (1 = "yes", 0 = "no")
$auth_allow_default = 1;

# Default permissions used if there is no authentication, or for a default
# user. (View, Add, Delete, Modify, Admin), 1 = enable, 0 = disable.
@auth_default_permissions = (1,0,0,0,0);

# Allow people to sign up for their own userid/passwords? They will
# recieve default permissions.
$auth_signup = 0;

# Permissions a new signup should get.
@auth_signup_permissions = (0,0,0,0,0);
# Registered users: can modify/delete _only_ own records. For this to make
# sense you should set default off or to 1,0,0,0.
$auth_modify_own = 0;

# Registered users: can view _only_ own records. For this to make sense
# you should turn off default permissions.
$auth_view_own = 0;

# Auth user field. This is the field position in the database used for storing
# the userid who owns the record. Set to -1 if not used.
$auth_user_field = -1;

# URL to send user if they chose log off. Leave blank and the script will return to
# the logon prompt (although this only makes sense if you are using authentication).
$auth_logoff = "";


# ===========================================================================
# Build up some variables from your definitions. Internal use only.
foreach (sort { $db_def{$a}[0] <=> $db_def{$b}[0] } keys %db_def) {
push (@db_cols, $_);
$db_sort{$_} = $db_def{$_}[1];
$db_form_len{$_} = $db_def{$_}[2];
$db_lengths{$_} = $db_def{$_}[3];
$db_not_null{$_} = $db_def{$_}[4];
$db_defaults{$_} = $db_def{$_}[5];
$db_valid_types{$_} = $db_def{$_}[6];
($_ eq $db_key) and $db_key_pos = $db_def{$_}[0];
}
1;

If you need anything else let me know. I made sure I uploaded in ascii and that all file permissions are set.

Queticon
Quote Reply
Re: CGI Error In reply to
The problem is in your "products.pl" file. The only thing I can think that might have happened is that you used the code from the "Configurator" as your entire file. The code from the second part of the configurator is only part of the html.pl file. You need to paste it over the existing subroutines.

If I am wrong about what happened, I'll need you to copy your products.pl file to a web-accessible directory (one where you would place html files) and rename it to products_pl.txt. Then come back and let me know where I can take a look at it.


------------------
JPD





Quote Reply
Re: CGI Error In reply to
JPdeni no actually you are write that is what I did was made a new file and pasted that in there. I will correct that now and try it. Let you know how it works.

Thank You

Queticon
Quote Reply
Re: CGI Error In reply to
JPdeni,

That worked...Duh!

Thank You
Queticon
Quote Reply
Re: CGI Error In reply to
Oh, we all do things that are less than brilliant from time to time. Smile Glad I was able to figure it out quickly so you could get to working with your database.


------------------
JPD