Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Add.cgi fields

Quote Reply
Add.cgi fields
Can someone please remind me how have information entered in the links addition form, by the user, sent out to the administrator in the 'links waiting to be validated' email, without being added into the database.

eg: a comments text box.

Thanks
Rennie

Quote Reply
Re: Add.cgi fields In reply to
You would need to create a new field in your add.html template and then in add.cgi in sub send_email add:

New Field: $in{'New Field'}


Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: Add.cgi fields In reply to
thanks Paul.

Rennie

Quote Reply
Re: Add.cgi fields In reply to
Glad I could help.

Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: Add.cgi fields In reply to
add.cgi doesn't contain this sub any longer... any other ideas about how it can be done?

Thanks
Rennie

Quote Reply
Re: Add.cgi fields In reply to
Aghhh

Ive done it again......

I forgot to look at the forum title - I gave you the answer for Links2.

You will need to use:

# Add the record.
$input->{ID} = $id = $db->add ( $input );
if ($id) {
# Mail the message away.
$to = $CFG->{db_admin_email};
$from = $input->{'Contact_Email'};
$subject = "Addition to Database: $input->{'Title'}\n";
$host = defined $ENV{REMOTE_HOST} ? "$ENV{REMOTE_HOST} ($ENV{REMOTE_ADDR})" : 'none';
$refer = defined $ENV{HTTP_REFERER} ? $ENV{HTTP_REFERER} : 'none';
$newfield = $input->{'NewField'};
my $cfg = Links::Config::load_vars();
my %tags = ( Host => $host, Referer => $refer, Category => $cname, NewField => $newfield);
$msg = GT::Template->parse ( $CFG->{admin_root_path} . '/templates/admin/email-val.txt', { %$input, %tags, %$cfg } );

Then add the newfield tag into the validation email text file.



Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: Add.cgi fields In reply to
thanks Paul,

Tried that but I'm getting the following compilation error:

Global symbol "$newfield" requires explicit package name at /xxx/xxx/cgi-bin/add.cgi line 179.

Rennie

Quote Reply
Re: Add.cgi fields In reply to
Find:

my ($rec, $to, $from, $subject, $msg, $host, $refer, $error);


and change to:

my ($rec, $to, $from, $subject, $msg, $host, $refer, $newfield, $error);


Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: Add.cgi fields In reply to
Hi,

Actually any CGI input is available in the email-val.txt field, so you can simply edit the template and put:

NewVal: <%NewVal%>

This is assuming you form field in named 'NewVal'.

Cheers,

Alex

--
Gossamer Threads Inc.