Gossamer Forum
Home : Products : DBMan : Customization :

Need a little help!

Quote Reply
Need a little help!
Hi JPDeni...glad to see you're back & feeling better..got abit of a situation..I'll try to be explicit. This could be a challege!
Data field (xxxx) in DBman form requires to cross reference and confirmed (xxxx.dat) file in another subdirectory exists. if yes process submission, if not then decline submission..
I know this is accomplished through db.cgi, but it's developing the code that's the problem..if you get a minute ..I would appreciate your help..thanks..Rob
Quote Reply
Re: Need a little help! In reply to
I suppose this would have to be in sub validate_record in db.cgi.

You need to get the path to the directory where the file will be. This is not the URL, but the full path. You can find the path by navigating to the directory in you ftp client. It should show you the path somewhere on your screen.

If you start to type "http://" where the path goes, you'll know you have the wrong thing.

I'm assuming this will be a required field.

In sub validate_records, just above

if ($#input_err+1 > 0) {

add

Code:
unless (-e "/path/to/directory/$in{'fieldname'}.dat) {
push (@input_err, "whatever you want your error message to say");
}

I think that should do it.

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





Quote Reply
Re: Need a little help! In reply to
HI Again...thanks for the quick response...posted code as directed..used absolute path..get Server Internal Error.
triple checked permissions etc...tried db.cgi without code..works fine...re-entered code the error again...Rob
Quote Reply
Re: Need a little help! In reply to
That's because I forgot a quotation mark.

Let's try it again.

Code:
unless (-e "/path/to/directory/$in{'fieldname'}.dat") {
push (@input_err, "whatever you want your error message to say");
}

Perl is picky! Smile

Sorry 'bout that.


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





Quote Reply
Re: Need a little help! In reply to
Thanks JPDeni...works great...a quick question....how busy are you?...I have a script (not Dbman) that I would like customised...it's a email subscribe/unsubscribe script..I would like to incorporate a password reference check, user name reference check and file delete feature..I don't need it immediately...over the next couple of weeks would be good...if you are feeling up to it and have a little time, I could give you additional data and you could give me a quote re: time and Dollars...thanks..Rob
Quote Reply
Re: Need a little help! In reply to
I'm glad it worked for you. Smile

Sorry, but I just don't have any time right now. Early tomorrow morning I'm going away for a week completely away from computers. And I have a list of things that I have to get done when I get back that will take me through September at least.


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