Gossamer Forum
Home : Products : DBMan : Installation :

prob in adding new input fields..

Quote Reply
prob in adding new input fields..
ref: http://azury.com/cgi-bin/dbman/db.cgi

1 default.cfg file============
=======================

$db_dir_url = "http://azury.com/cgi-bin/dbman";
$db_script_url = $db_dir_url . "/db.cgi";
$db_file_name = $db_script_path . "/default.db";
$db_id_file_name = $db_script_path . "/default.count";
$auth_dir = $db_script_path . "/auth";
$auth_pw_file = $db_script_path . "/default.pass";
$auth_log_file = $db_script_path . "/default.log";
require $db_script_path . "/html.pl";

'default', 'valid_expr']

%db_def = (
ID => [0, 'alpha', 9, 10, 1, '', ''],
RECD => [1, 'alpha', 8, 15, 1, '', ''],
PO => [2, 'alpha', 8, 20, 1, '', ''],
VENDOR => [3, 'alpha', 40, 255, 1, '', ''],
ITEM => [4, 'alpha', 40, 100, 1, '', ''],
BYR => [5, 'alpha', 12, 20, 1, '', ''],
DEL => [6, 'alpha', 12, 20, 1, '', ''],
EX1 => [7, 'alpha', 12, 20, 1, '', ''],
EX2 => [8, 'alpha', 12, 20, 1, '', ''],
EX3 => [9, 'alpha', 12, 20, 1, '', ''],
conf => [10, 'alpha', 15, 20, 0, '', ''],
inv => [11, 'alpha', 15, 20, 0, '', ''],
Userid => [12, 'alpha', -2, 15, 0, '', '']
);

$db_key = 'ID';
$db_key_track = 1;
$db_delim = '|';
$db_use_flock = 1;
$db_auto_generate = 0;
$db_benchmark = 0;
$db_debug = 0;
$db_max_hits = 10;
$db_bold = 1;
$font = 'font face="verdana,arial,helvetica" size="2"';
$font_title = 'font face="verdana,arial,helvetica" size="4"';

$auth_no_authentication = 0;
$auth_time = 21600; # 6 hours (in seconds)
$auth_logging = 1;
$auth_allow_default = 1;
@auth_default_permissions = (1,0,0,0,0);
$auth_signup = 1;
@auth_signup_permissions = (1,1,1,1,0);
$auth_modify_own = 0;
$auth_view_own = 0;
$auth_user_field = 12;
$auth_logoff = "http://www.assamcompany.com/webmerch";

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;
=========
2. html.pl===============
=============
$html_title = 'Database Manager Demo';
sub html_record_form {

my (%rec) = @_;
($db_auto_generate and print &build_html_record_form(%rec) and return);

my $font = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';

print qq|
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR>
<TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font>Record ID: </FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="ID" VALUE="$rec{'ID'}" SIZE="8" MAXLENGTH="15"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font>RECD: </FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="RECD" VALUE="$rec{'RECD'}" SIZE="8" MAXLENGTH="15"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>PO No: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="PO" VALUE="$rec{'PO'}" SIZE="8" MAXLENGTH="20"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>Vendor: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="VENDOR" VALUE="$rec{'VENDOR'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>Item: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="ITEM" VALUE="$rec{'ITEM'}" SIZE="40" MAXLENGTH="100"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>BYR: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="BYR" VALUE="$rec{'BYR'}" SIZE="12" MAXLENGTH="20"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>DEL: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="DEL" VALUE="$rec{'DEL'}" SIZE="12" MAXLENGTH="20"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>EX (1): </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="EX1" VALUE="$rec{'EX1'}" SIZE="12" MAXLENGTH="20"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>EX (2): </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="EX2" VALUE="$rec{'EX2'}" SIZE="12" MAXLENGTH="20"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>EX (3): </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="EX3" VALUE="$rec{'EX3'}" SIZE="12" MAXLENGTH="20"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>CONF: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="CONF" VALUE="$rec{'CONF'}" SIZE="15" MAXLENGTH="20"></TD></TR>
<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>Inv No. & Date: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="INV" VALUE="$rec{'INV'}" SIZE="15" MAXLENGTH="20"></TD></TR>

</TABLE>
|;
}

sub html_record {

my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';

print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Record ID:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'ID'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>RECD:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'RECD'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>PO No:</FONT></TD>
<TD> <$font>$rec{'PO'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Vendor: </FONT></TD>
<TD> <$font>$rec{'VENDOR'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Item: </FONT></TD>
<TD> <$font>$rec{'ITEM'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>BYR: </FONT></TD>
<TD> <$font>$rec{'BYR'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>DEL: </FONT></TD>
<TD> <$font>$rec{'DEL'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>EX (1)</FONT></TD>
<TD> <$font>$rec{'EX1'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>EX (2)</FONT></TD>
<TD> <$font>$rec{'EX2'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>EX (3)</FONT></TD>
<TD> <$font>$rec{'EX3'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>CONF:</FONT></TD>
<TD> <$font>$rec{'CONF'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Inv No.& Date:</FONT></TD>
<TD> <$font>$rec{'INV'}</Font></TD></TR>
</TABLE>
|;
}

=============

it was working earlier whn I kept the same default fieldnames.. etc..
whn I added new field names..
then the problem starts..

pls help

Babul

------------------
Hi!
Quote Reply
Re: prob in adding new input fields.. In reply to
One more thing:

how to change the default Admin password?

------------------
Hi!
Quote Reply
Re: prob in adding new input fields.. In reply to
What is your problem? It makes it a whole lot easier to figure out what's wrong if we know what we're looking for.

Quote:
how to change the default Admin password?

Log on with user name admin, password admin. Click the "Admin" link on the DB home page. Add a new user -- the name and password you want for yourself. Click all the boxes, including "Admin." Log off. Log on again with the user name and password you just added. Click the "Admin" link. Find "admin" in the drop-down list of users. Click the "Delete" button.

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

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

PS Looks like you already did that. I tried to go to your site to find out what the problem was and I couldn't log in with the admin password.

[This message has been edited by JPDeni (edited January 28, 1999).]
Quote Reply
Re: prob in adding new input fields.. In reply to
Hi

Thanks for the respo.

I have added two new fields at the end of the default form: CONF and INV (Invoice number/date). when I kept the field input is not necessary all the time.. it woked.. and when I kept it to 1 (field cannot be empty) and I try to add something.. i said the field is empty.. both the last two fields..

so how do I add record..
shall I do like.. autogenerate input form option to 1 (on)?

- the admin paswd I changed into: golaghat

thanks

------------------
Hi!