Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

check my logic, please (useful if it works)

Quote Reply
check my logic, please (useful if it works)
Hello everyone,

I'm creating a script called header.cgi that will call header.txt from the templates directory, require Links.pm and replace any <%variable%> with the appropiate $LINK{'variable'}, and place it on whatever webpage calls it with <!--#exec cgi="/admin/header.cgi"--. With this, I can have the same header.txt and footer.txt on the entire site with the same variables but not have to go and make a template and a subroutine in nph-build.cgi, etc.

Here is what I've done so far:

# Dan's Header Script That Works With Links SQL
# Created for CSNhome.com

require "Links.pm";

@header = <HEADER>;
$tags = join("",@header);

$tags =~ s/~\<\%site_title\%>\}~/$LINKS{'build_site_title'}/g;
$tags =~ s/~\<\%images\%>\}~/$LINKS{'images_directory'}/g;
$tags =~ s/~\<\%font\%>\}~/$LINKS{'normal_font'}/g;

print "$tags";

then I just call that from any .shtml page with <!--#exec cgi="/admin/header.cgi"--, shoudn't that work? Here is what the error log gave me:

httpd: [Mon Nov 27 21:12:36 2000] [error] [client] invalid CGI ref "/admin/header.cgi" in /www/csnhome/test.shtml
httpd: [Mon Nov 27 21:13:23 2000] [error] [client] invalid CGI ref "admin/header.cgi" in /www/csnhome/test.shtml

Thanks for any input! God bless!

Subject Author Views Date
Thread check my logic, please (useful if it works) OneDanShow 2100 Nov 27, 2000, 7:44 PM
Post Re: check my logic, please (useful if it works)
pugdog 2038 Nov 27, 2000, 7:52 PM