Gossamer Forum
Home : Products : DBMan : Customization :

user information at signup

Quote Reply
user information at signup
I did a bunch of searches for adding fields to the signup form but I couldn't find anything.

I'd like to create a database containing user information for people who have userid's in my databases. All of my databases use the same .pass file. Basically what I'd want to do is add a bunch of fields to the signup form - stuff like location, date signed up, rider style etc. (I have a biking website)

I'd set up a relation between the userid of the main databases and the user database. Main database has a "posted by" field that clicks into the user database.

Only 1 problem though, currently creating a new account uses this submit code:

<input type="SUBMIT" name="signup" value="Create">

And adding to the database is this:

<INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add Record">

How would I combine the two together so when the person signs up, they are added to both the .pass file and the user database?

Basically, I'd allow users to search through the user database for people in their area to go biking with. Of course there'd be an option for not making the user info visible to the public.

Is this too ambitious?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Try checking out my "Limit Number of Records per User" mods. The index for the mods is at http://www.jpdeni.com/...ds/limitrecords.html. There are options for a user to add a record at the time of signup, with and without the password lookup mod and with and without the "user-friendly" html.pl file.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I'm starting to think that this isn't really going to work right. I'm going to have several main databases - bike reviews, trail reviews, crash stories and classified ads. If the user clicks "sign in" on any of those db's they will be leaving the current database to sign up. Once they've signed up, they'd have to go back to the db that they came from. (people might get confused about where they are) Would it be possible to add data to the user database from within the main db's? Like use a "switch" in the main db's to pull the add record stuff from the user db?

limitrecords4.txt looks like it would do the trick for the user db. Then I'd just have the userid field as the key/common field from the user db to all the others.

I realize this is all confusing 'cuz of all the db's that I'm using and stuff --- I really appreciate all of your input!

Thanks.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
It's possible (though a real pain in the patootey) to have a value "follow" the user when he goes from one place to another. I use it in my bookstore db if people want to write a review, but haven't logged on yet. They go to log on -- or even sign up for an account -- and when they're done they're taken straight to the add form to add a review for the book they wanted to.

Is this what you want to do?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
To add a review to my main db, the mod that you used in your bookstore wouldn't really do the trick... but if someone were to add a comment to a review in the related database - it would. If its a real pain in the butt, I'm not sure if its totally neccessary.

Basically, what I'd like to do is if a user clicks the "sign up" button (from any of my 4 db's), they make a username and add a brief bio about themselves that may or may not be viewable by others depending on if they click "public" or "private" (radio field). In a bike review for example, there is a field - "Name", I'd like to be able to click that name and that users bio will show up. Bio's will be searchable to allow people to find possible bike riding partners. Once the user has entered their bio and their username, they are brought back to the database that they linked in from. This way, the person wouldn't have to re-enter the database that they were just in - this would avoid confusion.

Another little problem is that I imported about 500 db entries from another database that I'm using and not all of them have userid's that go along with the record -- I just plugged my userid in there. So I guess I'd have to put a switch with an IF statement to see if there is a corresponding profile entry to a userid and remove the link if there isn't.

If you need any more spec info, let me know.

Thanks again for your input!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I think I need a map. Smile Or a new brain or something. Or maybe it's that I've answered all the easy questions already. Now the really challenging ones are coming up. Or maybe it's my biorhythm.

Whatever it is, I'm just not seeing this at all.

Maybe we could take it one step at a time. Pick one of your databases. Any one at random. On what page(s) in that database would it be likely that a user would need to sign in?


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry this is so confusing...

Okay, I'm working on the bike review database so lets use that one. If $db_userid is "" or "default", navigation has these links:

what's new, search, list all, login, sign up.

If the user logs in from any one of those pages, navigation changes to this:

what's new, search, list all, add, modify, delete, change password, log off.

There are some extra options for admin access too if ($db_userid eq "admin")

So if a person hasn't signed in or doesn't have an account, they can only login or signup from the 1st set of links mentioned above.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Okay. Now I think I can handle it.

Let's assume that the person is going to sign up for a username and fill out the bio thing.

In your link for "sign up" add &old_setup=$db_setup.

In sub html_signup and sub html_signup success add a hidden field:

<input type="hidden" name="old_setup" value="$in{'old_setup'}">

At the beginning of sub html_home for the "user" database, add

Code:

if ($in{'old_setup'}) {
print "Location: $db_script_url?db=$in{'old_setup'}&uid=$db_uid\n\n";
return;
}
That should cause the user to go back to the bike reviews home page after he signs up and logs in. ("Should" being the operative word. Wink)


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Added what you said to the db's.

Couple questions/problems:

Tried to install limitrecords4.txt on my "user" database and I noticed that it doesn't mention putting a "userid" in the html_record_form, just a password.

I added a userid field to it and when it tried to sign up, it gave me the following error:

Invalid userid: jason. Must only contain only letters and be less than 12 and greater than 3 characters.

email address already exists.email address already exists.

(only had email problem on offline version for some reason)

I added the stuff from your limitrecords mod to the cfg.

$db_email_field = 'Email';
Email => [3, 'alpha', 20, 50, 1, '', ''],

$auth_user_field = 14;
Userid => [14, 'alpha', -2, 15, 0, '', '']

Bike reviews is accessible here:
http://www.visit-my-webpage.com/...ews&login_form=1 -- just click "login" in the left menubar.

Setup files are here: http://www.visit-my-webpage.com/tmp/

Thank you for your help!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
In Reply To:
Tried to install limitrecords4.txt on my "user" database and I noticed that it doesn't mention putting a "userid" in the html_record_form, just a password.
That's because it is assumed that you would already have a userid field in your database. You don't want two fields that are the same.

If you added the userid field to sub html_signup, take it out.

And please don't try adding the code I gave you earlier in this thread until you have worked out the limit records thing. Remember, one thing at a time.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
That's because it is assumed that you would already have a userid field in your database. You don't want two fields that are the same.

If you added the userid field to sub html_signup, take it out.
Sorry, I removed the userid stuff.

How would the person get a userid though? When the person clicks "signup" (from any db), it goes to the users db with the assumption that they do not have a userid or password.


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
You have a userid field in your users .cfg file, right? There should be a field on the add form for the userid. They enter it into that field.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Yes, "Userid" is in the cfg file.
Userid => [14, 'alpha', -2, 15, 0, '', '']

<input type="TEXT" name="userid" value="$in{'userid'}">

I put the input line in the html_record form however I'm still getting a couple errors when I try to add a record with a username/password.

I doesn't seem to like any userid... whatever I type, it errors out with - "Invalid userid: jdulberg. Must only contain only letters and be less than 12 and greater than 3 characters."

Thanks for your patience!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm going to need to look at your html.pl and .cfg files. I'm getting really confused.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
No prob. The links to the online version and the files are in a message a few posts up - 23-Jun-00 05:54 PM

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
There's a problem with the mod. Sorry.

In sub signup, change

unless ((length($in{$db_cols[$auth_user_field]}) >= 3) and (length($in{$db_cols[$auth_user_field]}) <= 12) and ($in{$db_cols[$auth_user_field]} =~ /^[a-zA-Z0-9]+$/)) {

Sorry 'bout that.

(I really do think there's something with my brain these days. Maybe it's too much sun. Cool)


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
You've been spending too much time working on dbman and stuff... people like me causing all kinds of trouble.

I changed sub signup to what you said but unfortunately I'm still getting the invalid userid error.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Do you have the $auth_user_field set correctly? Are you having them sign up to the correct database?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Your gonna kill me... Looks like I had "userid" instead of "Userid" in the html.pl. I changed some stuff around in the cfg and html.pl to get rid of a few required fields and it looks like its working now.

Once the record is added, I'm automatically logged in and it goes to the add_success page. Guess now its a matter of getting it to go back to the db that the person came from and getting the relation to work for making the username clickable if the user has a bio.

Thanks for putting up with me for so long!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
It happens. Smile

I've sorta lost my train of thought here. Do you have the hidden field

<input type="hidden" name="old_setup" value="$in{'old_setup'}">

in sub html_signup_form? (I forgot that you were using the "add a record at time of signup" thing. You won't need it in sub html_signup_success.)

If you have that field, check the source code for your signup form to make sure it's actually there and that the correct database name (the one you came from) has been entered.

If it has been, you have two choices. You can either have a link on your "add success" page to go back to where they were or you can just have it send them back without getting a success page.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Yep, its filled:
<input type="hidden" name="old_setup" value="bikereviews">

Is it possible to have it send them to the main page of the database that they came from with a little signup success message? If I have a link, some [dense] people might get confused about where they are.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Sure.

In sub signup, change

&html_signup_success;

to

print "Location: $db_script_url?db=$in{'old_setup'}&uid=$db_uid&new_user=1\n\n";

In db.cgi, sub main, change

Code:

elsif ((keys(%in) <= 2) ||
($in{'login'})) { &html_home; }
to

Code:

elsif ((keys(%in) <= 2) ||
($in{'login'}) || $in{'new_user'}) { &html_home; }
At the beginning of sub html_home, where you want to print out the confirmation message, add

Code:

if ($in{'new_user'}) {
print qq|Thank you for registering with $html_title.|;
}
or whatever you want it to say.

I think this will work. Smile It's a little different than what I'm using, but I think it will be necessary to do it this way.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Works like a charm! JPDeni, the DB Master strikes again.

Now, onto the final leg of this crazy modification.

I need to set up a relation between users and my other db's. For example, someone does a search in Bikereviews and they find a review by "fred". I'm pretty sure I know how to link to Fred's information but is it possible to have it so if the person doesn't have any user information, the link will not appear? I have about 1000 old entries in my db that don't have any user information so there would be nothing to link to.

If its too much of a pain to do, is there a way to add another view_failure so if the user has no info, it'll go to a page that says so instead of going to the normal view_failure? I'd like to keep the original view_failure for normal searches.

Thanks again for your ongoing support!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Cool! I think I'm gettin' the hang of this!! Wink

You could do a search for the user when the record prints out. It would be something like:

Code:

&switch_to_user;
%rec2 = &get_record($rec{$db_cols[$auth_user_field]});
&switch_to_whatever the current database is;
if ($rec2{$db_cols[$auth_user_field]}) {
print qq|link to the user|;
}
If you're already using %rec2 for something, you can change the hash name to anything you want it to be.

This does assume that your userid field has exactly the same name between databases and that the $db_key field for the user database is the userid field.

This is really a lot easier than making a different "view failure" page. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Okay, I added that and ran throught he relational setup but nothing appears -- looks like I'm gonna need a hand setting up the relation between users and my other db's.

I set the db_key in the users db to Userid like you said and Userid also exists in all of the other db's. So Userid is key/common in the users db.

I'm using %rec2 for my bikereview/comments db's so I guess I'd just change it to %rec3.

Updated all the files on the temp server if you want to see them. http://www.visit-my-webpage.com/tmp/

Maybe's I'll take the cake for one of the most modded dbman's? Once all the setup is done... I'm gonna be running 7 db's.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I know why it isn't working. (Duh! Blush)

Code:

&switch_to_users;
%rec3 = &get_record($rec{'Userid'});
&switch_to_bikereviews;
if ($rec3{'Userid'}) {
print qq|link to the user|;
}
I was trying to be more "generic" with the code, but what I had won't work!

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Awesome!! Works great. I'm gonna mess around with the display here and there and I'll post a message once its done so you can have a look at your mastery.

Thanks sooo much for your help!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Cool! I can't wait to see it.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Looks like I just ran into my first little problem.

You mentioned that I have to have a field "Userid" in both the bikereviews and users db's to get it all working. In my comments db (which relates to the bikereviews), I'm using "commentsUserid". If I change it to Userid, there would be 2 fields that are common with bikereviews instead of 1. BikeID is currently the common field.

Here's what my final db's are going to be:

bikereviews - related to commentsbikereviews, users
trailreviews - related to commentstrails, users
classifids - related to users
bestcrashes - related to users

I might be added a store review db at a later date. So with all of these db's relating to users, things might get a bit messy.

What I'm aiming to do is the following:
User has to sign up in the users db. When they go to add to any of the db's, their name, email, etc. is taken from the users db and plugged into the html_record_form.

So now, the users db is not only a searchable library of users, it sortof acts like a cookie.
Quote Reply
Re: user information at signup In reply to
I'm really not sure what you're asking, Jason. (I think my brain is going away again. Smile)

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry its so confusing... I just have too many related db's on the go.

To sum it up, I can't get the relation between my comments db and the users db working.

This is gonna get weird.

"commentsbikereviews" is related to bikereviews -- "users" is related to both of them.

commentsbikereivews' userid field is called "commentsUserid" because it has to be different from the bikereviews userid. Since the "users" db uses is userid and not commentsUserid, it doesn't relate to "commentsUserid".

Basically, all of my db's are going to have to relate to the users db.

Does that clear anything up?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Conceptually, it's extremely confusing. Smile But in practical terms, what are you wanting to do?

I got an idea, but I'm not sure if this is what you're doing or not.

The top of the page is the bike review. There is a link to the bio of the author of the review.

Below that there are comments about the bike review. In each one there is a link to the bio of the author of the comment.

Are you trying to work out how to get the link to the bio of the author of the comment?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry this is all so weird and confusing.

In Reply To:
Are you trying to work out how to get the link to the bio of the author of the comment?
Yes. The link to the bio from the review works perfectly, putting it on the comment and getting other data from the users db is the problem.

In all of my "review" db forms (trailreviews, bikereviews etc.), there are a couple fields that I'd like to fill with data from the "users" db. For instance, "if" a person has a bio and they fill out a review, the state/country fields for example are automatically filled by taking the info from the users db. -- like a cookie.

Does this clear anything up?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
You've got two very different things in your last post. You are talking about a link in the search results and you are talking about filling in forms. One thing at a time, please. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry.... guess I'm just ansy to get things working.

Getting the bio link into all of my db's is more important to autofilling the forms.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm sorry. I'm just not with it these days.

You can basically use the same code:

Code:

&switch_to_users;
%rec3 = &get_record($rec{'name of userid field in the database you're currently working with'});
&switch_to_name of current database;
if ($rec3{'Userid'}) {
print qq|link to the user|;
}
If your bike review comments record info is in a hash called %rec2, then use

%rec3 = &get_record($rec2{'name of userid field in the database you're currently working with'});


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry I took so long to reply and for this whole thing dragging out for as long as it has....

Anyways, I just plugged that into the comments db and it works fine. However, if I try to put it in sub html_record in the reviews db, something weird happens. For some reason, $long_url is getting messed up if this is in there:

%rec3 = &get_record($rec{'Userid'});

For some reason, $long_url stays the same for about 5-10 links then "nh=" jumps and does the same thing. So clicking the links will give an invalid result. If I comment out the #rec3 statement, it works again.

I uploaded all of the files to the server so you can see what I mean. Its weird.

Bike reviews is accessible here:
http://www.visit-my-webpage.com/...ews&login_form=1 -- just click "login" in the left menubar and log in as "admin/admin".

Setup files are here: http://www.visit-my-webpage.com/tmp

Also, for some strange reason, all of the comments that are added to the reviews show up for each record.... not just the one with the corresponding BikeID. I went through the steps that you gave me to set it up and it all looks fine. I don't even think that I touched anything in that part of the html.pl.

Thank you for your ongoing envolvement in my project!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm getting really overwhelmed with this. This is so complicated. I don't even know where to begin.

I did notice that, when I looked at a review, there were two comments. One of them said ID:22 and the other said ID: Yes. This tells me that your bike comments reviews database is messed up. You didn't add or delete any fields in the .cfg file after adding records, did you?




JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I've ovewhelmed the dbman goddess!!?!? Uh oh, that's not good.

Sorry, there was some remnants of old entries in the comments.db on the server -- just updated it.

Even when I emptied the comments db and readded stuff, the error occurs. I removed 2 fields in the comments cfg and I changed the $auth_user_field accordingly and the switch sub in db.cgi. Would that cause the problem?

To make things even more baffling, comments only show up when you do a list all.... if you do a search on any field, the results don't have a comment in them (even if they are supposed to).

With my luck, its most likely the stupidest little problem... finding it is the trouble. I'd determined though.


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'll tell you what. I will give you my Sunday. Hubby will be spending the day taking his mother out to dinner, so I will have the whole day. And there's usually not a lot of traffic on the forum on Sundays.

Put all of your files into your directory -- including the .db files -- with .txt extensions and I'll pick them up and install them on my own server so I can see what's going on. Deal? Smile


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Wow... the royal treatment! I can't tell you how appreciative I am right now!!!! If I had tons of cash, I can tell you right now, I'd be sending some your way!

Sounds like a plan. I'll put all of the stuff into the directories that I mentioned in a bunch of messages in this thread. I'll put the working version online as well -- just so its running on my temp server.

I should be around Sunday so if you want to send me email instead of posting to the board, that's may be easier. Its up to you.

Thanks again!!!!!!!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I should have asked this before, but I guess better late than never.

In bikereviews_html.pl, sub html_record, you say

In Reply To:
## problem here. If %rec3 is commented out, List all works correctly. If its left, $long_url gets messed up
#%rec3 = &get_record($rec{'Userid'});
What do you mean "messed up"? Can I get an example of the $long_url both with the line and without it?

I know you explained it earlier, but I really need a specific example.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I just saw something that can be a major problem.

In users.cfg, you have

ID => [0, 'numer', 5, 8, 1, '', ''],

and

Userid => [16, 'alpha', -2, 15, 1, '', '']

and

# The column name for the database key. Can be any column, but it must be unique!
# You can't have two records with the same key value!
$db_key = 'Userid';
# Track the key? Should DBMan keep a counter of the next key to use? This isn't
# neccessary if you can guarantee that your entry in the key field will be unique
# (i.e. a userid).
$db_key_track = 1;


Not good.

I don't know why you have the ID field, but you definitely should not have $db_key_track=1 if your key field is the userid field.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
What do you mean "messed up"? Can I get an example of the $long_url both with the line and without it?
When %rec3 is commented out, long_url is correctly incremented. Ifs its left in, long_url loses proper incrementation.

In Reply To:
I don't know why you have the ID field, but you definitely should not have $db_key_track=1 if your key field is the userid field.
In users.cfg, ID is just the record number - that could just be changed to Usercount or something like that. I'd like to have a user counter just so I know how many accounts there are. I need to keep Userid -- it relates to all of the datbases.

How would I remedy this problem?

Thanks for looking at my files!


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
There are other ways to keep track of the number of registered users. The only way that the ID field is incremented is if it is the $db_key field.

I would eliminate the ID field from users.cfg.

Regarding the other problem -- I really need to see the URL that is generated when the line is active and when it isn't. That's the only way I can tell what the problem is.

What I'm doing right now is setting up a simplified version of your databases on my home computer -- one database at a time. No fancy page formatting or anything. Just the basic database structure. I'll let you worry about making it pretty. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
I would eliminate the ID field from users.cfg.
Sounds fine to me.

In Reply To:
Regarding the other problem -- I really need to see the URL that is generated when the line is active and when it isn't. That's the only way I can tell what the problem is.
Okay, right now, the version that I have online doesn't have %rec3 commented out. Log into
http://visit-my-webpage.com/...iews&uid=default as admin/admin and do a "list all". Mouseover the fields listed under "brand" or "model". Notice in your browser's status bar that nh= does not increment correctly when you move down the list. If you click on one of the reviews, it has the wrong data or its not there at all. When %rec3 is commented out, everything works okay with nh= however the link to the users db under "posted by" no longer appears.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I think I got it. It's a conflict with variable names.

Try adding $i to the "my" line at the beginning of sub get_record:

my ($key, $found, $line, @data, $field, $restricted, $i);

I'm sorry I've been so dense.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
Try adding $i to the "my" line at the beginning of sub get_record:

I'm sorry I've been so dense.
No worries... Anyways, I added the $i but unfortunately it didn't work.


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Okay. Let's try something else then.

In sub html_view_success, change

$i = 1; to $rec_count=1;

++$i; to ++$rec_count;

In sub html_record, change

$record_number = ((($nh - 1) * $db_max_hits) + $i); to
$record_number = ((($nh - 1) * $db_max_hits) + $rec_count);

I know that somewhere there is a conflict with the $i variable which is causing this. So now we change the $i variable to something else.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Worked like a charm! DBMan goddess strikes again!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Yay!!!!!

My brain has been in such a fog lately, I couldn't even figure out what was going wrong, much less how to fix it.

Anything else?


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sitting in front of a computer all day definitely turns grey matter into mush -- I can totally relate to that!

I'm still having the problem with all of the comments being listed under the review even if the comment BikeID doesn't correspond with one review BikeID.

Also, you mentioned that I should lose ID in users.cfg. Would I just set $db_key_track to 0 then?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Yes. $db_key_track should be set to 0 if you are using the userid field as the key field. This is really important. If you don't, you're going to have major problems.

I've been playing around at your site and I'm not sure what's going on with the commentsbikereviews database. I did a search for all comments and I got two returned, but also links to two other pages. Neither had anything on them, but the links shouldn't have been there.

I don't know what would have caused this, but it could be related to your other problem.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I just removed ID from the cfg, db.cgi and from the .db itself. Changed $db_key_track to 0 as well. I'm still having the comments problem though. I even tried commenting out all of the %rec3 stuff to see if that was causing a conflict but it didn't do anything.

There are only 2 records in the comments db so I don't know what those other 2 links that you were talking about are. The records in the comments db have the correct BikeID and are validated so I don't just can't figure out why they aren't being pulled by the corresponding review. The comments switch/search obviously finds the info but it just doesn't know what to do with it.



-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm not sure either. But you need to make the same change in your other html.pl files that you made in the bikereviews one -- change $i to $rec_count.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
In Reply To:
change $i to $rec_count.
Done... didn't effect the problem with the comments though. They all still show up no matter what BikeID they are supposed to go with.

I just updated the files in the tmp folder.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
I'm still concerned about the commentsbikereviews database. It is not coming up right when I do a "List All." If there's something wrong with the database itself, then the relational mod won't work.

Try starting with a new commentsbikereviews.db file.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
How is it not right? I just went to it and it looked okay - sort of. Under "brand" and "model", its taking those from the reviews database. The brand/model's that are listed there do not correspond with the comment. The public will not be able to do a list all/add/delete etc. directly from the comments db - clicking the links will bring them back the the bikereviews. Only admin has access to those functions in the comments db.

Just noticed something interesting. In the comments db, clicking delete/modify gives an error on the validated field. Clicking add gives a blank page - just the header/footer.

Feel free to add/delete/modify anything you want.

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Right now I'm still logged in to your database. If you go to

http://visit-my-webpage.com/...*&view_records=1

you'll see that the two comments are listed, as well as links to a page 2 and page 3. But there's nothing on those pages. For some reason the script is thinking that there are more results than there really are. This is a problem! Smile


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Woa... I didn't even notice that. That's really weird! I had a look at the comments html.pl and for some reason $db_next_hits doesn't show up above the results but it does below it.

Both are:
if ($db_next_hits) { print "
<$font>Pages: $db_next_hits</font>"; }

Could the counter in html_view_success be messed up?

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
There is something with the BikeID field. I'm not sure what it is, but I think that's what's causing both problems.

Are you sure you have it in the correct place in both of the "switch_to_" subroutines?

What seems to be happening is that, not only are all the comments returned on the reviews page, but all of the reviews are returned when you list the comments.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
I think its okay.... here's what I have:

sub switch_to_bikereviews {
#----------------------------------------------
$cols = 'BikeID,Name,Email,State,Country,Date,Brand,Model,Review,Category,Rating,Userid,Validated';
@db_cols = split /,/,$cols;
$db_file_name = $db_script_path . "/data/bikereviews.db";
$db_sort{'Date'} = 'date';
$db_validated_field = 'Validated';
}


sub switch_to_comments_bikereviews {
#-----------------------------------------------------
$cols = 'ReviewID,commentsName,commentsEmail,commentsDate,commentsReview,commentsRating,commentsUserid,commentsValidated,BikeID';
@db_cols = split /,/,$cols;
$db_file_name = $db_script_path . "/data/comments_bikereviews.db";
$db_key_pos = 0;
$db_validated_field = 'commentsValidated';
}

omments .cfg:

ReviewID => [0, 'numer', 5, 8, 1, '', ''],
commentsName => [1, 'alpha', 20, 50, 1, '', ''],
commentsEmail => [2, 'alpha', 20, 50, 1, '', ''],
commentsDate => [3, 'date', 12, 15, 1, &get_date, ''],
commentsReview => [4, 'alpha', 0, 500, 1, '', ''],
commentsRating => [5,'alpha', 0, 50, 1, '', ''],
commentsUserid => [6,'alpha', -2, 15, 0, '', ''],
commentsValidated => [7,'alpha', 0, 3, 0, 'No', 'Yes|No'],
BikeID => [8, 'numer', 5, 8, 1, '', '']

bikereviews cfg:

BikeID => [0, 'numer', 5, 8, 1, '', ''],
Name => [1, 'alpha', 20, 50, 1, '', ''],
Email => [2, 'alpha', 20, 50, 1, '', ''],
State => [3, 'alpha', 20, 50, 1, '', ''],
Country => [4, 'alpha', 20, 50, 1, '', ''],
Date => [5, 'date', 12, 15, 1, &get_date, ''],
Brand => [6, 'alpha', 20, 75, 1, '', ''],
Model => [7, 'alpha', 20, 75, 1, '', ''],
Review => [8, 'alpha', 0, 500, 0, '', ''],
Category => [9, 'alpha', 0, 50, 1, '', ''],
Rating => [10,'alpha', 0, 50, 1, '', ''],
Userid => [11,'alpha', -2, 15, 0, '', ''],
Validated => [12,'alpha', 0, 3, 0, 'No', 'Yes|No']


-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Yep. It does look all right. (I wish it didn't. Then I would know how to fix it. Smile)

Maybe if I play around at your site some more I'll get some inspiration. Doesn't make any sense to me, but maybe I'll get a brain storm.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Sorry it took me so long to reply. I've been trying to access the site since last weekend but I keep getting a DNS error. Found out the IP address now so I'm using that...

Anyways.... About my crazy dbman problems. Could it be something with the %rec3 stuff that was added? It worked before I added all the User stuff to the db.



-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Carol, your not going to believe this!!!! I just added the security fix that Alex posted and it fixed the comments problem! Comments are now displaying with their corresponding review!

I couldn't believe it when I saw it -- it was a total fluke. I just uploaded the revised db.cgi to the server so you can see it actually working.

I hope that's the last stupid problem that I run into while setting up my db's.

Just want to thank you again for all of your help and patience on this project!!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net
Quote Reply
Re: user information at signup In reply to
Wow!!!! Who woulda thunk it? Smile

That is amazing, but I never argue with success.

You have taken a great load of my mind. I'm almost as happy about this as you are!!!! Smile





JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: user information at signup In reply to
Certainly a load off my mind too. I can finish the new site now.

Thanks again!

-----------
Jason Dulberg
Extreme MTB
http://extreme.nas.net