theguy.. no you can't do that.. that's why cookies suck
the Links SQL one i made uses the user database to save the data.. so it doesn't use cookies.. that way the data can be used anywhere..
ok.. this version doesn't require much.. it only requires CGI.pm and CGI/Carp.pm.. if you don't have CGI/Carp.pm you can just take a line out and it will be ok.. but you have to have CGI.pm.. if you don't have CGI.pm then you have to use a cookie library like Matt's cookie.lib.. or the one i wrote (in the other thread)..
also.. you can set how many days you want the cookie to expire.. for the demo.. i set the cookie to expire in 3 years from the time set.. it's dynamic because with CGI.pm you don't have to set the exact date.. you can say
'+1y +3m +15d +6s'
to expire in 1 year, 3 months, 15 days, and 6 seconds..
here is just a skim through of the instructions..
ADD
Code:
sub site_html_my_link {
my %rec = @_;
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('my_link.html', {
%rec,
%globals
});
}
sub site_html_my_home {
my $tags = shift;
print &load_template ('my_home.html', {
%$tags,
%globals
});
}
sub site_html_my_add {
my %rec = @_;
print &load_template ('my_add.html', {
%rec,
%globals
});
}
sub site_html_my_add_error {
my $message = shift;
print &load_template ('my_add_error.html', {
message => $message,
%globals
});
}
sub site_html_my_delete {
my %rec = @_;
print &load_template ('my_delete.html', {
%rec,
%globals
});
}
sub site_html_my_delete_all {
my $tags = shift;
print &load_template ('my_delete_all.html', {
%$tags,
%globals
});
}
sub site_html_my_delete_error {
my $message = shift;
print &load_template ('my_delete_error.html', {
message => $message,
%globals
});
}
to site_html_templates.pl (if you don't use site_html.pl.. you'll have to figure it out yourself.. it's actually not that hard.. if you don't know how to do it.. email me (jsu7785@email.com)..
then you need like 7 templates... i think you guys should be able to figure these out yourselves.. first..
my_link.html
(very similiar to link.html.. except you add something like
Code:
<a href="mylinks.cgi?delete=<%ID%>">delete</a
my_home.html
(main thing to this is <%total%> and <%link_results%> .. you guys might want span pages.. if so.. tell me and i'll implement it.. (i might as well.. so i'll do it after i post this message)..
my_add.html
(you can put any link tags here..)
my_add_error.html
(the only tag other than globals is <%message%>.. which contains the error message..)
my_delete.html
(you can put any link tags here..)
my_delete_all.html
(you can put <%total%> here to tell them how many links there were that they deleted)
my_delete_error.html
(the only tag other than globals is <%message%>.. which contains the error message..)
and finally.. mylinks.cgi..
http://www.widgetz.com/mylinks.txt jerry