Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

What is wrong ?

Quote Reply
What is wrong ?
########################################################################################
# THE FOLLOWING ARE CGI GENERATED PAGES AND THE TEMPLATE MUST BE PRINTED, NOT RETURNED!#
########################################################################################

sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $category = shift;
$category ?
($category = qq~$category <input type=hidden name="Category" value="$category">~) :
($category = &build_select_field ("Category", "$in{'Category'}"));



sub navmenu {

my $navmenu = qq| <(!just to show you)--#include virtual="/nav.html" --> |;

return $navmenu;

}

print &load_template ('add.shtml', {
Category => $category,
navmenu => &navmenu,
%globals
} );



}

Can you tell me how please how to PRINT my SSI ?

Thanks

Quote Reply
Re: What is wrong ? In reply to
1) You cannot include a SUB within a SUB like you are attempting to do.

2) You have not carefully searched the forums since this has been addressed before where people have mentioned that you cannot use SSI directives within CGI/Perl scripts.

Search the Links 2.0 Customization forum for SSI.

Regards,

Eliot Lee
Quote Reply
Re: What is wrong ? In reply to
but it works in all pages exept pages after line:

########################################################################################
# THE FOLLOWING ARE CGI GENERATED PAGES AND THE TEMPLATE MUST BE PRINTED, NOT RETURNED!#
########################################################################################

Quote Reply
Re: What is wrong ? In reply to
Yes because you have a SUB in a SUB like ELIOT said.

Joke
$_ = 'uyodrasdskucs'; $i = 0; while ($i++ < 11) { s/(.{2})(.)/$2$1/g; } print $_;

Quote Reply
Re: What is wrong ? In reply to
What is the solution ?

Thanks

Quote Reply
Re: What is wrong ? In reply to
This:

Code:
sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $category = shift;
$category ?
($category = qq~$category <input type=hidden name="Category" value="$category">~) :
($category = &build_select_field ("Category", "$in{'Category'}"));



sub navmenu {

my $navmenu = qq| <(!just to show you)--#include virtual="/nav.html" --> |;

return $navmenu;

}

print &load_template ('add.shtml', {
Category => $category,
navmenu => &navmenu,
%globals
} );



}
Should be:

Code:
sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $category = shift;
$category ?
($category = qq~$category <input type=hidden name="Category" value="$category">~) :
($category = &build_select_field ("Category", "$in{'Category'}"));

print &load_template ('add.shtml', {
Category => $category,
navmenu => &navmenu,
%globals
} );

}


sub navmenu {

my $navmenu = qq| <(!just to show you)--#include virtual="/nav.html" --> |;

return $navmenu;

}
Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: What is wrong ? In reply to
:) you are wrong
In this section we can't use RETUR !!!!

This code located after line :
########################################################################################
# THE FOLLOWING ARE CGI GENERATED PAGES AND THE TEMPLATE MUST BE PRINTED, NOT RETURNED!#
########################################################################################

anyways I tryed
and NOW I have a : fatal error: Undefined subroutine &main::site_html_add_form

Guys I'm Newbie in CGI and I need your help

Thanks

Quote Reply
Re: What is wrong ? In reply to
Uh I'm not wrong!

Look are you asking for help or do you know it all?

You asked for a solution and I told you what to do and then you tell me I am wrong...go figure...

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/

Quote Reply
Re: What is wrong ? In reply to
Does it mean you do not know the answer ?
Sorry Paul but I tryed your advice and it doesn't work.
I did't try to hurt you :) Sorry :)
I was trying to bring your attention to PRINT & RETURN stuff

I hope you still willing to help me

Thanks

Quote Reply
Re: What is wrong ? In reply to
As discussed tons of times you CAN'T use SSI in CGI pages.

To use SSI in any of the other Links2 pages add this to the globals:

ssi => &ssi

Then...

sub ssi {

my $ssi = qq|<!--#include virtual="/file.html"-->|;

return $ssi;

}



Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/