Gossamer Forum
Home : Products : DBMan : Customization :

userid field

Quote Reply
userid field
OK. I must be going mad. I have a large html.pl script which uses 63 fields (0 - 62). Field 62 is named 'userid' and this exact word is used throughout the script and is defined in the cfg file as such.

In trying to print $rec{userid} nothing is returned, and no userid record is saved in the database. All other fields are being saved correctly.

Another virtually identical script is working perfectly well. In that, the field is named 'Userid' (note upper case U).

The problem script was also written originally with an uppercase U, but did not work. I attempted to correct the situation by turning all instances to lower case.

At no point in the script do I use <INPUT> for userid.

I do not know how the db script picks the userid up, so am having difficulty debugging the script. I have carefully checked spelling etc, but have drawn a blank. Any ideas?
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.
Quote Reply
Re: [davidolley] userid field In reply to
Here are some "guesses" I can think of...

make sure you're using $rec{'userid'} - probably just a typo here in the forum

check the config and see if you have userid "turned off" (set to "-1" I believe)

try using <input type="hidden" name="userid" value="$rec{'userid'}">

Just typing quickly and shooting from the hip here...
Quote Reply
Re: [Watts] userid field In reply to
Thanks for the suggestions, Watts. I had already checked those things, and many more. I just do not understand why I cannot get the Userid value returned.

I am not a perl programmer, but assume that the Userid field is the Login input, so should be available, for instance to print immediately the script executes. ie I should be able to print qq| $rec{'Userid'} |; anywhere within the html.

Or am I wrong? As I said, the script executes properly in every other respect, and another script which I modified to create this one works perfectly well.

Is there a limit to the number of fields that the script can handle?
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.
Quote Reply
Re: [davidolley] userid field In reply to
You are storing the userid within the database correct?

If so, check in your .cfg file to be sure you have this line set correctly to match the field of your userid.

$auth_user_field = 63;

Also make sure that your fields are numbered consecutively within your .cfg file starting with 0 (zero), if not that can cause problems.

Perhaps you could provide access to view your .cfg file.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] userid field In reply to
Thanks for your interest Lois. The cfg file is at http://www.afil.co.uk/...ds/companies.cfg.txt

The html file is:

http://www.afil.co.uk/...s/UKCoappform.pl.txt but I don't expect you to wade through that!

I am sure that it has to be a matter of woods and trees and not being able to see .....
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.
Quote Reply
Re: [davidolley] userid field In reply to
After reviewing your files I found that in your .cfg file you have the same field listed twice:

Dir2DOB => [54,'date',20,20,0,'',''],
Dir2DOB => [55,'date',20,20,0,'',''], # should be Dir3DOB

I think that would cause problems for sure, and I did notice that the field size and maxlength in your .cfg file differ from what is in your html_record_form for several fields.

Are you having users input their Userid or are you wanting it to be automatic when the logged in user adds a record? If yes, then if you check the FAQ under "Admin" there is a thread related to having the userid filled in unless you are logged in as admin.

Hope this helps

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] userid field In reply to
Lois. I did say that I couldn't see the wood for the trees! I checked that cfg files so many times, but failed to notice that typo. A fresh look usually does the trick, and I wish I had someone here to check over my stuff.

Of course, that solved the problem immediately - all on its own.

I agree about the field lengths. They will be tidied up now, but I knew they would not be causing a problem.

Thanks so much for taking the time to spot my silly mistake.
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.
Quote Reply
Re: [davidolley] userid field In reply to
Great, I'm glad that worked to get your database fixed.

Yes, at times it's just one small thing that can really mess up the whole process. An extra set of eyes do help :)

At times it has taken me hours to locate one small problem, checking over everything several times.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/