Gossamer Forum
Home : Products : DBMan : Customization :

Saving it into 2 databases?

Quote Reply
Saving it into 2 databases?
It is possible for the dataman program to save added info into two databases with one submit button? if it is how do we do that? thanks
Quote Reply
Re: Saving it into 2 databases? In reply to
Yes, it is possible.

The process depends on exactly what you want to do. Do you want to write all of the same fields to both databases? Do you want to write some fields to one and some to another? I'll need more info about what you want before I can help.


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





Quote Reply
Re: Saving it into 2 databases? In reply to
Hello JPDeni,

Thanks for giving some attention to my question. Actually, what I want is to make dbman and this signup form work together http://mail.digitelone.com/Signup.html .
it is possible to have a form html similar to dbman that save the four fields found in http://mail.digitelone.com/Signup.html to its database and the rest save to the dbman database? Our main problem is that our existing form is not cgi and their support told us to just embed cgi program. Maybe this url can help what i want http://support.zipmail.com/signup/ they have similar program with us however they were able to do what i want.

I hope my question didn't bother you much

Best Regards,

Mp3luzon
Quote Reply
Re: Saving it into 2 databases? In reply to
No problem. I'm here for the evening helping someone else who's working on a deadline. I'm happy to help.

If I understand correctly, then, you want some of the fields in the signup form to be added to the .db file and some to be added to the .pass file. Right?

If this is what you want, first go into sub html_signup_form and add the fields you want to be added to the .db file. When you get that done, come back and we'll work on how to get them actually added. Smile


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





Quote Reply
Re: Saving it into 2 databases? In reply to
Hello once again!

Ok I'm done with the fields I want to be added to the dbman .db you can see here http://www.digitelone.com/cgi-bin/dbman/
db.cgi?add_form=1 I removed the menu links of the dbman. Can you help on how to combine the new fields with the signup field found in this url http://mail.digitelone.com/Signup.html . With regards to my original question it is possible to combine the two signup form/html into one html file with one submit button and save it into two different databases?

best regards,
Mp3luzon
Quote Reply
Re: Saving it into 2 databases? In reply to
Let's back up again and make sure I understand what you want to do.

You want users to sign up for an account, but you want them to fill out more than just username and password when they do. And you want the other fields to be added to the database at the same time the users sign up for an account. Is this correct?

If so, you need to first allow users to sign up for an account. Have you set

$db_signup=1;

in your .cfg file? When I tried to access the signup form, I just got the main menu.

After you are sure that user's can sign up for accounts --

use

http://www.digitelone.com/cgi-bin/dbman/db.cgi?signup_form=1

to access the form --

add fields to the signup form that you want users to fill out when they signup for an account.

You can't do this by using sub html_add_form. You must do it in sub html_signup_form.


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





Quote Reply
Re: Saving it into 2 databases? In reply to
Helloo!!

--------------------------------------------
You want users to sign up for an account, but you want them to fill out more than just username and password when they do. And you want the other fields to be added to the database at the same time the users sign up for an account. Is this correct?
-------------------------------------------
Definitly you're right! All I want an additional fields to know other info of the people who signup in our web mail. Its no problem with me if that fields save in other database as long us after filling those new fields they will be automatically login into web mail like what the default web email program does right now.

Additional info:

It is not necessary the username and password will be save in default.pass of dbman. The only important point here is that I can save the new fields in the default.db and users wont be allow to view, modify, any account.

I'm going to work first the fields you told me .. the adding of fields at the sub html_signup_form

thanks again

mp3luzon
Quote Reply
Re: Saving it into 2 databases? In reply to
You've added some more information here.

You want users to fill out a form to be able to access a web email program. (Is this something you have worked out in DBMan, or something else?) You want to have the information yourself, but you don't want anyone else to be able to view it. And, if a user returns, he will again have to enter a username and password, since you don't want them saved to a .pass file.

I don't know if this can be done.


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





Quote Reply
Re: Saving it into 2 databases? In reply to
I think this link http://www.digitelone.com/cgi-bin/dbman/
db.cgi?add_form=1 will do what i need. Actually I dont need all the features of dbman. Here is what I got on my mind.. If a person want to sign up in our web email he will go to this link http://www.digitelone.com/cgi-bin/dbman/
db.cgi?add_form=1 then after he will click the signup(add record) button I need to let him fill out our original sign up form which is located in this url by redirecting him to http://mail.digitelone.com/Signup ..

How do I do that in the dbman code?


pls stay with me!

Thanks
Quote Reply
Re: Saving it into 2 databases? In reply to
I'm just trying to figure out what you are going to do with the data after the user fills out the form.

Will the user be able to come back to your site and use the web email without filling out the form a second time? Do you need to pass any of the values to the web email program?

I just don't understand what you're doing.


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





Quote Reply
Re: Saving it into 2 databases? In reply to
Hi!

I will just keep the data that the user will fill up for marketing strategy purpose for example I will know from the data how many users who sign up that came from Hong kong etc.

---------------You wrote--------------------
Will the user be able to come back to your site and use the web email without filling out the form a second time?
---------------------------------------------
Yes they will only sign up once. And they can come back to our site.

To revieww what we are talking here:

Our currently database has four fields and we dont need to focus oon this they are already existing.

1. Login in name
2. Realname
3. Password
4. retype password

Our new database which is done by using the add new record feature of dbman. This is a different database to remind you. And these are the new fields:

1. Login name
2. Age
3. City/Province
4. Country
5. Where did you hear us?
.
.
.
I already did this and its working. You can find this at:http://www.digitelone.com/cgi-bin/dbman/db.cgi?add_form=1


Maybe you will understand what Í want by going to this url http://www.digitelone.com/cgi-bin/dbman/
db.cgi?add_form=1 then SIGN UP then click the add record button then you will see a new html page telling you that you added that record. What I want is to change that result page to http://mail.digitelone.com/Signup ?

Best regards

Mp3luzon
Quote Reply
Re: Saving it into 2 databases? In reply to
I still don't know if DBMan is going to work for this.

You say that the users log in using an existing database. Is this a DBMan database?


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





Quote Reply
Re: Saving it into 2 databases? In reply to
The existing database is not dbman.. I dont have a plan to combine that with dbman database thats why my first question to you if it is possible to have one html form and when we will click the submit button it will save some fields to its specified database let say " I want the username field and password will be save to our existing database while the other fields like age, country etc will be save to dbman flat file database."

Anyway I'm still working on this coz I really need to let this thing work..

Best regards and Thanks for help..

mp3luzon
Quote Reply
Re: Saving it into 2 databases? In reply to
The problem with saving it to another database that is run by another program is that each database program has its own format for its files. I would have to know what the format for the other program's file is in order to know whether DBMan could write to the file.

(Now I do understand what you're doing, though. Sometimes it takes a while to sink in my thick skull! Smile )


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





Quote Reply
Re: Saving it into 2 databases? In reply to
Back to you JPDeni...

Thanks a lot for staying with me. Look what I've done so far I've redirected the add form using dbman to our existing signup mail when user click the NEXT button after filling up.
http://www.digitelone.com/cgi-bin/dbman/db.cgi?add_form=1

my current problem is that...this add form is allowing me to sign up same username which it should not. OPPSS I think I posted this in seperate topic. SOrry Smile
Quote Reply
Re: Saving it into 2 databases? In reply to
Oh, that's okay. If I find that I'm repeating myself in threads, I'll just switch to one or the other. No biggie.

To keep users from being able to enter the same userid as a previous record, set your

$db_key

to the userid field and set

$db_key_track = 0;

That should work.

I have an idea that might work for you.

Instead of the "Verifying Account" page, you can go straight to your email signup page. All you have to do is copy the Signup.html page into sub html_add_success. You could even enter the userid and "Real Life Name" from the add form so users wouldn't have to type it again. Is that something you would like to do?


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





Quote Reply
Re: Saving it into 2 databases? In reply to
Hello!

------------ you wrote--------------------
All you have to do is copy the Signup.html page into sub html_add_success. You could even enter the userid and "Real Life Name" from the add form so users wouldn't have to type it again. Is that something you would like to do?

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

Thats What I meant.. just arrived at my work place and I'm going to give it a try.


Thanks

Quote Reply
Re: Saving it into 2 databases? In reply to
Hello there!

------------ you wrote--------------------
All you have to do is copy the Signup.html page into sub html_add_success. You could even enter the userid and "Real Life Name" from the add form so users wouldn't have to type it again. Is that something you would like to do?

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

I already copy the signup page into sub html_add_success to remove the redirection page. I got this problem when I click "next" it show the http://www.digitelone.com/cgi-bin/dbman/db.cgi page. Actually, this is really the thing I dont understand.. I just can't point my submit button to our current mail sign up script we have because I dont know what script it is... it only shows

<FORM method=post enctype="multipart/form-data">

how can I point the sub add_html_success to enctype="multipart/form-data which is unknown?

try this in order for you to understand what I mean.

http://www.digitelone.com/cgi-bin/dbman/db.cgi?add_form=1

If we can't think option the solution b4 would be fine which is having to button.

thanks....

Quote Reply
Re: Saving it into 2 databases? In reply to
Maybe it is within the "mail.digitelone.com" URL that tells which script to use. I think you'll have to go back to the redirect link.

Or you could have the db.cgi script redirect the user directly from sub add_record. Instead of

&html_add_success;

use the redirection line.

Sorry for all the confusion. I'm really slow at figuring things out sometimes.


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





Quote Reply
Re: Saving it into 2 databases? In reply to
Helloo its me again!!

I have made what i want running however its not that super friendly like the html.pl. What I want is to make a rountine like what html.pl does ... the add form routine or the its more on the html form part. my curent field form in which where users fills up looks like this :




I'm just a damn who doesn't understand that much. To simplify everything how can make the code above to look like add form in which its easy to cut paste html code.


***sorry if I decided to post here. I just thought i'm still in the same project Smile whew**
Quote Reply
Re: Saving it into 2 databases? In reply to
Opps!! heres the code!


BEGIN
{
use FindBin qw($Bin);
use lib "$Bin";
}#This is for web server so it could find CLI.pm from the current directory

use strict;
use CLI;
use CGI qw(:standard);

print header; # Print "Context-type: text/html"

# print "<HTML>"
# print "<HEAD>User Creation Sample CGI</HEAD>"
# print "<BODY>"
print start_html("User Creation Sample CGI");

if($PostmasterPassword eq "") { # You didn't specify domain/login/password

errormsg("You have to modify the script file to specify the CGPro Server address and Postmaster password");

} elsif(param()) { # The form is already filled
# Read the parameters from the form
my $Account = param("account");
my $RealName = param("realname");
my $Password1 = param("password1");
my $Password2 = param("password2");
my $Age = param("age");
my $City = param("city");
my $Country = param("country");
my $Schcompany = param("schcompany");
my $Altemail = param("altemail");
my $Wheredidyou = param("wheredidyou");
my $BoxType = param("boxtype");

if ($Account eq "") {
errormsg("No account name specified");
}
if ($Password1 eq "") {
errormsg("No account name specified");
}
if ($Password1 ne $Password2) {
errormsg("Passwords do not match!");
}
if ($Age eq "") {
errormsg("Age can't be blank!");
}
if ($City eq "") {
errormsg("City/Province can't be blank!");
}

if ($Country eq "") {
errormsg("Country can't be blank!");
}
if ($Schcompany eq "") {
errormsg("School/Company can't be blank!");
}
if ($Altemail eq "") {
errormsg("Alternative Email can't be blank!");
}

if ($Wheredidyou eq "") {
errormsg("Where Did you find us? can't be blank!");
}



my $cli = new CGP::CLI( { PeerAddr => $CGServerAddress,
PeerPort => 106,
login => $PostmasterLogin,
password => $PostmasterPassword } );
unless($cli) {
errormsg("Can't login to CGPro: ".$CGP::ERR_STRING);
}

my $UserData;
@$UserData{'RealName'}=$RealName;
@$UserData{'Password'}=$Password1;
@$UserData{'Age'}=$Age;
@$UserData{'City'}=$City;
@$UserData{'Country'}=$Country;
@$UserData{'Schcompany'}=$Schcompany;
@$UserData{'Altemail'}=$Altemail;
@$UserData{'Wheredidyou'}=$Wheredidyou;
if($cli->CreateAccount(accountName => $Account,
accountAge => $Age,
accountCity => $City,
accountCountry => $Country,
accountSchcompany => $Schcompany,
accountAltemail => $Altemail,
accountWheredidyou => $Wheredidyou,
accountType => $BoxType,
settings => $UserData)) {
print h1("Account created.");
print a({-href=>'CreateUserCGI.pl'}, 'Create a User');
} else {
errormsg("Can't create account: ".$cli->getErrMessage);
last MAIN;
}
$cli->Logout;

} else { # The form is empty
print h1("Create a user: "),hr();
print start_form();
print p("Account name: ",textfield("account"));
print p("Real name: ",textfield("realname"));
print p("Password: ",password_field("password1"));
print p("Password (again): ",password_field("password2"));
print p("Age:", textfield("age"));
print p("City:",
popup_menu( "city", ['Cavite City','MultiMailbox','MailDirMailbox']));
print p("Country:", textfield("country"));
print p("Schcompany:", textfield("schcompany"));
print p("Altemail:", textfield("altemail"));
print p("Wheredidyou:", textfield("wheredidyou"));
print p("Mailbox type: ",
popup_menu( "boxtype", ['TextMailbox','MultiMailbox','MailDirMailbox']));
print p(submit("Create"),reset("Clear"));
print end_form(),hr();
}
print end_html(); # print"</BODY></HTML>"

sub errormsg { #a procedure to output error message in HTML format and exit
my ($msg) = @_;
print h1("ERROR: $msg");
print a({-href=>'CreateUserCGI.pl'}, 'Create a User');
print end_html();
exit;
}




***sorry if I decided to post here. I just thought i'm still in the same dbman interest Smile whew**
Quote Reply
Re: Saving it into 2 databases? In reply to
I'm sorry. I can't figure out the code in most Perl programs. I've been really spoiled by DBMan.

I don't understand the syntax they are using here at all.


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