Gossamer Forum
Home : Products : Gossamer Links : Discussions :

add.cgi: check field value in links table

Quote Reply
add.cgi: check field value in links table
Hi,

I've modified add.cgi to use a unique identifier tag 'Rcpt' (passed as add.cgi?Rcpt=xxxxxx) to put in field 'rcpt' and it works fine, but I've found that someone can go back and re-use the form to submit another entry with the same rcpt reference - I don't want that.

I'd like add.cgi to check the currect links database for 'rcpt' and report an error if it finds and existing entry with the same rcpt reference (this is to stop them using the form for more than one submission.)

I've setup the error reporting and checking for the presence of 'rcpt', so now I just need a code snippet to check the links.

In my v1.13 I have the duplicate URL check that uses $db->query and $db->hits to establish if the input for 'URL' exists, but it doesn't appear to work the same for 2.x

Here's what I'm using:

Code:
# Check for duplicate rcpt in links

my $chk_rcp = $db->query ( { rcpt => $IN->param('rcpt') } );

if ($chk_rcp) {
print $IN->header();
print Links::SiteHTML::display('error', { error => Links::language('DUP_RCPT')});
exit;
}
... but this returns the error every time.

Firstly, have I got the query right?
Secondly, how would I check for 'hits'?

Any help appreciated Smile

All the best
Shaun

Subject Author Views Date
Thread add.cgi: check field value in links table qango 5023 Apr 5, 2001, 1:23 AM
Thread Re: add.cgi: check field value in links table
Fortune 4606 Apr 5, 2001, 3:36 AM
Thread Re: add.cgi: check field value in links table
qango 4602 Apr 5, 2001, 4:38 AM
Post Re: add.cgi: check field value in links table
Alex 4586 Apr 6, 2001, 8:42 AM