For those who have .shtml pages (or even just your main page), here is a quick gimmicky mod to show a welcome message to people who have submitted links to your directory before.
In your cgi-bin make a new file called welcome.cgi with this code in it:
my $IN = new CGI;
print "Welcome back $val!";
} else {
print "Welcome Guest!";
}Then in either home.html or any .shtml page you like add:
<!--#exec cgi="/cgi-bin/welcome.cgi"-->
Then in add.cgi change:
&site_html_add_success;to.....
use CGI qw(:standard);
if ($in{'Contact Name'} =~ /\w+\s\w+/) {
split /\s/, $in{'Contact Name'};
$name = $_[0];
} else {
$name = $in{'Contact Name'};
}
$ck = cookie( -name => "WelcMSG",
-value => $name,
-expires => '+5yr',
-domain => ''
);
print header ( -cookie => $ck );
&site_html_add_success;...then finally in sub site_html_add_success in site_html_templates.pl remove &html_print_headers;
Return visitors will then get a message like "Welcome back Paul"
Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com
In your cgi-bin make a new file called welcome.cgi with this code in it:
Code:
#!/usr/bin/perlCode:
use CGI qw(:standard); my $IN = new CGI;
Code:
$val = $IN->cookie('WelcMSG');Code:
if ($val) { print "Welcome back $val!";
} else {
print "Welcome Guest!";
}
<!--#exec cgi="/cgi-bin/welcome.cgi"-->
Then in add.cgi change:
Code:
# Send the visitor to the success page. &site_html_add_success;
Code:
# Send the visitor to the success page. use CGI qw(:standard);
if ($in{'Contact Name'} =~ /\w+\s\w+/) {
split /\s/, $in{'Contact Name'};
$name = $_[0];
} else {
$name = $in{'Contact Name'};
}
$ck = cookie( -name => "WelcMSG",
-value => $name,
-expires => '+5yr',
-domain => ''
);
print header ( -cookie => $ck );
&site_html_add_success;
Return visitors will then get a message like "Welcome back Paul"
Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com