Gossamer Forum
Home : Products : DBMan : Customization :

Two versions of DBman share a .db file

Quote Reply
Two versions of DBman share a .db file
In order to let visitors to choose different language versions of dbman, I made a copy of my current relational dbman scripts and gave them different name. The two dbmans share .db, .count. .log files. Then I changed the settings in the newly copied .cfg, html.pl and format.pl files to specify the .db file and cgi directory. The entire files will look like this:

version 1
------------------------
db.cgi
user.cfg
user_html.pl
item.cfg
item_html.pl
format.pl

version 2
------------------------------
db_1.cgi
user_1.cfg
user_html_1.pl
item_1.cfg
item_html_1.pl
format_1.pl

shared files
-------------------------
user.db
user.count
item.db
item.count

In theroy, when user enter any version of dbman, he should be able to stay always in that version. However, what I got is not what expected. If I enter using http://myserver/db_1.cgi?db=user, I am able to login, however, all link still point to db.cgi not db_1.cgi. I can also add records by typing in the address line like http://myserver/db_1.cgi?db=item&uid=xxxxxxxx&add_form=1, when I submit my record, the add sucessful page goes to db.cgi again. I am sure I have changed the setting for db.cgi to db_1.cgi in the .cfg files. I could not figure out what could be wrong. I appreciate any clues.

Thanks in advance

Long

Quote Reply
Re: Two versions of DBman share a .db file In reply to
http://myserver/db_1.cgi?db=user
http://myserver/db_1.cgi?db=item&uid=xxxxxxxx&add_form=1

Shouldn't you be using

http://myserver/db_1.cgi?db=user_1
http://myserver/db_1.cgi?db=item_1&uid=xxxxxxxx&add_form=1

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Two versions of DBman share a .db file In reply to
since two versions share the same .db, the differences are the name of db.cgi and html.pl file, so in the url, db=user or db=item should be correct.

Long

Quote Reply
Re: Two versions of DBman share a .db file In reply to
Except that you have two different .cfg files.

You know what you could do, though --

In db_1.cgi, change

$in{'db'} ? ($db_setup = $in{'db'}) : ($db_setup = 'default');

to

$in{'db'} ? ($db_setup = "$in{'db'}_1") : ($db_setup = 'default');

Give that a try and see if it works for you.

JPD
http://www.jpdeni.com/dbman/