You may change other basic setting and HTML or a part of HTML (see the advice for a little learnt).
Or you may change something little more than HTML (see the advice for a good HTML user).
Handling inputs
Now you may try some real "Perl" scripting. Open link.cgi
| ### get input ###
: : $value =~ s/%0D%0A/<br>/g; $value =~ s/%0A/<br>/g; $value =~ s/%0D/<br>/g; $value =~ s/%09/ /g; $value =~ s/%3C/</g; $value =~ s/%3E/>/g; |
The middle one, $value =~ s/%09/ /g; changes a tab to five spaces. Since HTML cannot understand ordinary tab, you can ignore a tab by deleting this line.
LazyLinksLimited does not accept HTML tag sent by the guest. If you want HTML tag able, delete the last two lines
$value =~ s/%3C/</g;
and
$value =~ s/%3E/>/g;
But you do so only after you learn a cgi script security and understand the risk you are going to take.
Link order
The original cgi adds a new URL at the top of each group. If you want the latest link goes to the bottom of old links, go down to
| ### add new link ###
while (<DATAF>) { print LOCK; if (/<!--$group-->/) { print LOCK $newd."\n"; $thank = "URL has been successfully added."; $mlsub = "New link on LazyLinksLimited"; } } |
| and change the location of print LOCK; to |
| ### add new link ###
while (<DATAF>) { if (/<!--$group-->/) { print LOCK $newd."\n"; $thank = "URL has been successfully added."; $mlsub = "New link on LazyLinksLimited"; } print LOCK; } |
Ban access
You can limit the access by checking the IP address, $ENV{'REMOTE_ADDR'} or checking the browser, $ENV{'HTTP_USER_AGENT'}. To ban an IP address, for example, go to
| ################
# main script # ################ if ($ENV{'QUERY_STRING'} eq $tool) { |
| and insert |
| ################
# main script # ################ if ($ENV{'REMOTE_ADDR'} eq '123.456.78.90') {die "You cannot be here";} if ($ENV{'QUERY_STRING'} eq $tool) { |