Ok this is how you pass the data from one data base to another. in the main db you want to put the link in the "sub html_record", if you put it in the "sub html_record_form" any data that is not saved will not pass. Next the URL string: My string looks like this,
"toby" is the name of the dir where the 2nd db is that i want to pass the information to. "db=default" is the cfg file in toby that points to the 2nd db. "&uid=$in{'uid'}"is your login information (i use the same pass file and auth as i do in the db1. i'll show how i did that when we get to the cfg file.) "&add_form=1" this is the form where the data will be placed. Any field from the 1st. db that you want to pass should look like this. &Company=$rec{'Company'} you can add as many of them as you like. That is it for the db1. in DB2 (toby) we need to make some changes in the cfg file. "main" is the dir where the main db (db1) is placed. "tobydb.db" is in this dir. as you can see i point db2 "auth and pass" to db1 so you can move from one db to the other without having to login again. # File and URL's # -------------------------------------------------------- # URL of the directory dbman resides in. No Trailing Slash Please. $db_dir_url = "http://website.com/cgi-bin/toby"; # 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 . "./main/tobydb.db"; # Full path and file name of the counter file. $db_id_file_name = $db_script_path . "/default.count"; # Full path and file name of the authorization directory. $auth_dir = $db_script_path . "./main/auth"; # Full path and file name of the password file. $auth_pw_file = $db_script_path . "./main/default.pass"; # Full path and file name of the log file. $auth_log_file = $db_script_path . "/default.log"; # Full path and file name of the html routines. require $db_script_path . "/html.pl"; That is it for the cfg file. Now for the string to get the data into the rec. http://website.com/cgi-bin/toby/db.cgi?db=default&uid=admin.144077486113967&add_form=1&ID2=4374&Userid=edknue&Company=Webco%20Printing&Contact=Ed%20Knue&sb=1 dbman will covert to the data from db1 to db2 and it will look like this. At this point you should be at the "add rec form". This form has to have a field for each of the fields in your link. you can not use the "auto generate". This is what part of mine looks like. you will notices that the fields in my form has "$in{'Company'}" the "$in" is what the string is looking for to place the information in the field. you can all so have other fields if you want to add addtional information to the same rec. here we use "$rec{'Address'}" the "$rec" is what we use to write to the db. sub html_record_form { # -------------------------------------------------------- # The form fields that will be displayed each time a record is # edited (including searching). You don't want to put the #
and
tags for each field. # The values to be displayed are in %rec and should be incorporated # into your form. You can use &build_select_field, &build_checkbox_field # and &build_radio_field to generate the respective input boxes. Text and # Textarea inputs can be inserted as is. If you turn on form auto # generation, the program will build the forms for you (all though they may # not be as nice). See the README for more info. 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|
Invoice:
Userid:
Company:
Contact:
Address:
CSZ:
Phone:
Email:
|; } That's it. i hope this helps others who need to pass information from one db to another. Ed-