As I continue my efforts to upgrade to linksSQL, I came across the same problem most users of links have seen...
(anyone interested in seeing my progress go to http://www.magicdirectory.com/linksSQL/)
BTW most of my problems have been solved because of Andy, many thanks.
I would like the login to display login / logout on all pages. Granted this problem has many fixes, but none practical for me. I use an include for in ssh of a php file for the html pages, and the cgi pages I cannot seem to get down. I can use <%if Username%> and it will work if I want to edit each individual cgi page. However, my header is where I want the login/logout to appear. Unfortuantely, the header appears in both html and cgi pages.
Here is what I have and what I would figure would work that I call in my header from <%log%>:
'log' => 'sub {
my $output;
if ($ENV{SCRIPT_NAME} =~ /nph-build/) {
$output = \'<!--#include virtual="/log.php" -->\';
}
else {
use CGI::Cookie;
my %cookie = fetch CGI::Cookie;
if ($cookie{"s"}) {
$output = qq| <a href="$CFG->{db_cgi_url}/user.cgi?logout=1">Logout</a>|;
}
else { $output = qq| <a href="$CFG->{db_cgi_url}/user.cgi">Login</a>|; }
}
return $output;
}',
The html pages load the php file and it will display logout / login correctly. The perl pages, however, always display logout. According to my reasoning this should work. Any thoughts once again is greatly appreciated.
Thanks,
- Jonathan
(anyone interested in seeing my progress go to http://www.magicdirectory.com/linksSQL/)
BTW most of my problems have been solved because of Andy, many thanks.
I would like the login to display login / logout on all pages. Granted this problem has many fixes, but none practical for me. I use an include for in ssh of a php file for the html pages, and the cgi pages I cannot seem to get down. I can use <%if Username%> and it will work if I want to edit each individual cgi page. However, my header is where I want the login/logout to appear. Unfortuantely, the header appears in both html and cgi pages.
Here is what I have and what I would figure would work that I call in my header from <%log%>:
Code:
'log' => 'sub {
my $output;
if ($ENV{SCRIPT_NAME} =~ /nph-build/) {
$output = \'<!--#include virtual="/log.php" -->\';
}
else {
use CGI::Cookie;
my %cookie = fetch CGI::Cookie;
if ($cookie{"s"}) {
$output = qq| <a href="$CFG->{db_cgi_url}/user.cgi?logout=1">Logout</a>|;
}
else { $output = qq| <a href="$CFG->{db_cgi_url}/user.cgi">Login</a>|; }
}
return $output;
}',
The html pages load the php file and it will display logout / login correctly. The perl pages, however, always display logout. According to my reasoning this should work. Any thoughts once again is greatly appreciated.
Thanks,
- Jonathan