Hello, I was the creator of a Cold Fusion based "email friends" site. ran off of an Access DB. people enter their info, etc...other users can search for a "friend" by chosing a drop down for "Country" and "Gender" and a submit button queries the DB to return ALL of the user's information,except thier login:password. How can I do this with DBman? I keep trying, but I dont know where what and how I need to change in the cfg and pl file. Someone please help. I'll send you cookies or something
Aug 30, 1999, 11:45 AM
Veteran / Moderator (8669 posts)
Aug 30, 1999, 11:45 AM
Post #2 of 16
Views: 4786
I don't know what kind of file structure you have in your Cold Fusion file. I think you're going to have to start from scratch, although there might be a way to export the data you have into a format that DBMan can read.
You might try looking at my "Configurator" at http://www.jpdeni.com/dbman/config.html to help you set up your .cfg file and the subroutines you'll need in the html.pl file.
------------------
JPD
You might try looking at my "Configurator" at http://www.jpdeni.com/dbman/config.html to help you set up your .cfg file and the subroutines you'll need in the html.pl file.
------------------
JPD
Aug 30, 1999, 9:03 PM
Veteran / Moderator (8669 posts)
Aug 30, 1999, 9:03 PM
Post #3 of 16
Views: 4777
You don't need to offer anything for me to help you. (I'm not offended that you did, though. )
First, have you installed the DBMan demo? If not, do that now. Make sure it works on your system.
Then, set up your database. You can use all the same fields except the username and password. Then test it out again and see that it works the way you want it to.
Do not go on to the next step until you have fully tested each one and you know that everything is going well.
You might want to consider installing my "Secure Password Lookup" mod, which will assure that users enter a correct email address and will allow users to get a new password if they lose their current one.
Since you're new to Perl and CGI, I suggest you take a look at my tutorial, which begins at
http://www.jpdeni.com/dbman/tutorial.html . I have tried to make it as simple as I could for complete "newbies." If you have any questions along the way, don't hesitate to ask.
------------------
JPD
First, have you installed the DBMan demo? If not, do that now. Make sure it works on your system.
Then, set up your database. You can use all the same fields except the username and password. Then test it out again and see that it works the way you want it to.
Do not go on to the next step until you have fully tested each one and you know that everything is going well.
You might want to consider installing my "Secure Password Lookup" mod, which will assure that users enter a correct email address and will allow users to get a new password if they lose their current one.
Since you're new to Perl and CGI, I suggest you take a look at my tutorial, which begins at
http://www.jpdeni.com/dbman/tutorial.html . I have tried to make it as simple as I could for complete "newbies." If you have any questions along the way, don't hesitate to ask.
------------------
JPD
Aug 30, 1999, 9:18 PM
Veteran / Moderator (8669 posts)
Aug 30, 1999, 9:18 PM
Post #5 of 16
Views: 4787
No, you don't have to use | as a delimiter. You can use anything you want to.
If you want a tab-delimited file, you would use
$db_delim = "\t";
Note that I used double quotes for this. It's important that you do that.
I would caution against using something like
$db_delim = '","';
Sometimes when you export a text file from Access you get quotes around each of the field values. (You can turn that off, though.) The trouble is that Access also starts the first field with a ", which DBMan will not recognize.
Oh, some things I can think of that won't work for delimiters --
"\n" which is a newline
'~~' which DBMan uses
'``' which DBMan uses
Everything else is fair game, but it would probably be better not to use something that normally appears in the file. It shouldn't mess up your database, but it will make things harder to read if you ever need to look at the .db file.
------------------
JPD
If you want a tab-delimited file, you would use
$db_delim = "\t";
Note that I used double quotes for this. It's important that you do that.
I would caution against using something like
$db_delim = '","';
Sometimes when you export a text file from Access you get quotes around each of the field values. (You can turn that off, though.) The trouble is that Access also starts the first field with a ", which DBMan will not recognize.
Oh, some things I can think of that won't work for delimiters --
"\n" which is a newline
'~~' which DBMan uses
'``' which DBMan uses
Everything else is fair game, but it would probably be better not to use something that normally appears in the file. It shouldn't mess up your database, but it will make things harder to read if you ever need to look at the .db file.
------------------
JPD
Aug 30, 1999, 9:36 PM
Novice (9 posts)
Aug 30, 1999, 9:36 PM
Post #7 of 16
Views: 4777
now, I have the DB file. What I would like is for someone to go to my search page, such as:
www.premweb.com/efriend/searchbod.htm
and select the country in a pull down
and select the gender in a pull down
and click SUBMIT
and then it brings the person to the results page. How do I get people to go directly to page without having to "login"?
www.premweb.com/efriend/searchbod.htm
and select the country in a pull down
and select the gender in a pull down
and click SUBMIT
and then it brings the person to the results page. How do I get people to go directly to page without having to "login"?
Aug 31, 1999, 8:25 AM
Novice (9 posts)
Aug 31, 1999, 8:25 AM
Post #10 of 16
Views: 4771
Yes, I did convert it to a text file. You can see my real email friends at:
http://www.premweb.com/efriend
Please let me know if you think I can honestly do this with Dbman. If you would like to help me, I would really appreciate it. I am a graphic artist more than a programmer .
thanks
http://www.premweb.com/efriend
Please let me know if you think I can honestly do this with Dbman. If you would like to help me, I would really appreciate it. I am a graphic artist more than a programmer .
thanks
Aug 31, 1999, 8:31 AM
Veteran / Moderator (8669 posts)
Aug 31, 1999, 8:31 AM
Post #11 of 16
Views: 4780
Yes. DBMan can certainly do this. The structure would be a little different, because signing up for an account in DBMan is a two-step process, but you can have the same kind of data.
I will be glad to help you along the way, if you have any specific questions.
------------------
JPD
I will be glad to help you along the way, if you have any specific questions.
------------------
JPD
Aug 31, 1999, 8:53 AM
Novice (9 posts)
Aug 31, 1999, 8:53 AM
Post #12 of 16
Views: 4772
thanks so much! I honestly dont even know how to approach this in a CGI sense. I see that I can have a complete website in one cgi-document. As you can see on my emailfriend's page, I have multiple documents and such.
I also have a problem setting up the DB. My orginal table contains everything...even the person's userid/password for their "edit you file" section. I've even developed an "admin" section for me to edit/erase and addfiles.
Ill make you anygraphics you want if you can help me make this happen. Please let me know. ..I will definately give you the credit you deserve.
-tony
I also have a problem setting up the DB. My orginal table contains everything...even the person's userid/password for their "edit you file" section. I've even developed an "admin" section for me to edit/erase and addfiles.
Ill make you anygraphics you want if you can help me make this happen. Please let me know. ..I will definately give you the credit you deserve.
-tony
Aug 31, 1999, 10:30 AM
Veteran / Moderator (8669 posts)
Aug 31, 1999, 10:30 AM
Post #16 of 16
Views: 4770
On a static html page, you will not be able to allow users to sign in before they do a search. (Just wanted you to know that.)
Create your form like this:
<input type=hidden name="db" value="default">
<input type=hidden name="uid" value="default">
<input type=hidden name="ww" value="1">
What gender would you like to hear from?
<SELECT NAME="gender">
<OPTION value="*"> both genders</OPTION>
<OPTION value="Male"> Male</OPTION>
<OPTION value="Female"> Female</OPTION>
</SELECT><BR>
What country would you like to have a penpal in? </FONT></B><FONT COLOR="#660000">
<SELECT NAME="country">
<OPTION value="country name">country name</OPTION>
(repeat above line for each country)
</SELECT>
<CENTER>
<P><INPUT TYPE="SUBMIT" name="view_records" VALUE="Search it!'"></P>
Make sure you look at the text in bold above. You may need to change those things to match your database. In the "db" hidden field, the value must match the name of your .cfg file -- it probably will be default. Make sure that you use the full URL to the db.cgi script. Make sure that the field names -- gender and country are *exactly* the same as defined in your .cfg file. Case and spelling count!
------------------
JPD
[This message has been edited by JPDeni (edited August 31, 1999).]
Create your form like this:
Code:
<form action="http://url/to/db.cgi" method="GET"> <input type=hidden name="db" value="default">
<input type=hidden name="uid" value="default">
<input type=hidden name="ww" value="1">
What gender would you like to hear from?
<SELECT NAME="gender">
<OPTION value="*"> both genders</OPTION>
<OPTION value="Male"> Male</OPTION>
<OPTION value="Female"> Female</OPTION>
</SELECT><BR>
What country would you like to have a penpal in? </FONT></B><FONT COLOR="#660000">
<SELECT NAME="country">
<OPTION value="country name">country name</OPTION>
(repeat above line for each country)
</SELECT>
<CENTER>
<P><INPUT TYPE="SUBMIT" name="view_records" VALUE="Search it!'"></P>
Make sure you look at the text in bold above. You may need to change those things to match your database. In the "db" hidden field, the value must match the name of your .cfg file -- it probably will be default. Make sure that you use the full URL to the db.cgi script. Make sure that the field names -- gender and country are *exactly* the same as defined in your .cfg file. Case and spelling count!
------------------
JPD
[This message has been edited by JPDeni (edited August 31, 1999).]