Currently, I'm using password protection for resource (link) modification. Password protection and modification are based on the link ID and a user defined password. When a user clicks on "Modify" they are taken to a page where they must input their link ID and their password before they are taken to the modify page, where the fields are then filled in with the current values for their resource. This works well, and is based off of Paul's modify password protect mod.
Here's the deal. To encourage folks to keep their listings up-to-date, I would like to include a modify link with each listing in the directory. That's easy enough, but what I'm trying to do is pass the link ID to the modify page and have it pre-fill in the Resource ID: Text Box. (so all they have to do is input their password.)
I'm very knew to Perl (which will be obvious in a minute) and I'm not sure if I'm even going about this correctly. Maybe there is an easier way?
Here's how I'm trying to do this:
In link.html I have:
<a href="<%db_cgi_url%>/modify.cgi?id=<%ID%>">[Modify]</a>
In site_html_templates.pl I have the following to pass the id value to the modify_pre.html template:
sub site_html_modify_pre {
# --------------------------------------------------------
# This routine determines how the modify form page will look like.
&html_print_headers;
print &load_template ('modify_pre.html', {
Id => $id,
%globals
});
}
And then in my modify_pre.html template I've added this to stick the ID value into the field:
<input name="ID" value="<%Id%>" size="10">
Where I'm stuck is I don't know how to tell modify.cgi to grab the value of 'id' (sent with the link), set it to $id and then pass $id to the site_html_modify_pre subroutine in site_html_templates.pl
Sorry 'bout the long post, but I don't know where else to turn. I feel like maybe there's an easier way to do this and that I'm going about it all wrong. It's not real important that I get this to work, but it is driving me crazy-- mostly because I don't know how to do it and I guess I'm just the curious type.
Elaine
Here's the deal. To encourage folks to keep their listings up-to-date, I would like to include a modify link with each listing in the directory. That's easy enough, but what I'm trying to do is pass the link ID to the modify page and have it pre-fill in the Resource ID: Text Box. (so all they have to do is input their password.)
I'm very knew to Perl (which will be obvious in a minute) and I'm not sure if I'm even going about this correctly. Maybe there is an easier way?
Here's how I'm trying to do this:
In link.html I have:
<a href="<%db_cgi_url%>/modify.cgi?id=<%ID%>">[Modify]</a>
In site_html_templates.pl I have the following to pass the id value to the modify_pre.html template:
sub site_html_modify_pre {
# --------------------------------------------------------
# This routine determines how the modify form page will look like.
&html_print_headers;
print &load_template ('modify_pre.html', {
Id => $id,
%globals
});
}
And then in my modify_pre.html template I've added this to stick the ID value into the field:
<input name="ID" value="<%Id%>" size="10">
Where I'm stuck is I don't know how to tell modify.cgi to grab the value of 'id' (sent with the link), set it to $id and then pass $id to the site_html_modify_pre subroutine in site_html_templates.pl
Sorry 'bout the long post, but I don't know where else to turn. I feel like maybe there's an easier way to do this and that I'm going about it all wrong. It's not real important that I get this to work, but it is driving me crazy-- mostly because I don't know how to do it and I guess I'm just the curious type.
Elaine

