Gossamer Forum
Home : General : Perl Programming :

SSI problem !

Quote Reply
SSI problem !
hi,
im setting up ssi on my server, but im getting this error when i call a script through ssi .

HTTP/1.0 200 OK Date: Wed, 18 Aug 1999 20:45:10 GMT Server: Microsoft-IIS/4.0

any ideas ?

Quote Reply
Re: SSI problem ! In reply to
How are you "calling" the file to execute? Please post your codes here and also tell us what file extension you are using for both files.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI problem ! In reply to
Was the previous server Unix or NT? BTW, do SSIs work on NT? The error is not your typical SSI error. At any rate the problem appears to be related to HTTP headers. I've heard that IIS requires an additional line to be added. What it is I do not know.

And please post the code of the script, news_reader.pl.

Dan Smile
Quote Reply
Re: SSI problem ! In reply to
Hi,
Both server are NT.

here is new_reader.pl ( it is supposed to insert the headlines of articles into page using SSI) :

#!/usr/local/bin/perl

###################################################################
###################################################################
push (@INC, "j:\\laith\\htdocs\\cgi-bin\\entertainment\\movies\\reviews\\");
require "config.pl";



$head="$tempdir\\newshead.plate";
$foot="$tempdir\\foot.plate";
$sorry="$tempdir\\sorry.plate";
$list="$tempdir\\list.plate";

&parse_form;
$ticker=0;


&open_file("DATAFILE","",$datafile);
$read_file ;
&read_template($incoming=$head);


foreach $line (sort(date_sort &read_file("DATAFILE")))
{

# split the fields at the | character
@tabledata = split("\t",$line ,10);
$snuffy="yes";
&check_record;


## BEGIN VIEW


if ($field6 eq "published" ){
$counter++;
&read_template($incoming=$list);

}




}

## END VIEW


close(DATAFILE);


if ($counter==0) {
&read_template($incoming=$no_news);
}

&read_template($incoming=$foot);

exit;


sub read_template {

$field2link=$field2;
$field2link=~ s/ /%20/g;

local (%listvals) = ("!FIELD1!", "$field1", "!FIELD2LINK!", "$field2link", "!FIELD2!", "$field2", "!FIELD3!", "$field3", "!FIELD4!", "$field4", "!FIVE!", "$five", "!FIELD6!", "$field6", "!FIELD7!", "$field7", "!FIELD8!", "$field8", "!FIELD9!", "$field9", "!FIELD10!", "$field10", "!FIELD11!", "$field11", "!FIELD12!", "$field12", "!FIELD13!", "$field13");

local ($template) = "$incoming";
open(TEMPL, "$template") | | print "no file found $template!";
$template = "";

while(<TEMPL> )
{
$template .= $_;
}

close(TEMPL);

for $ikey (keys(%listvals))
{
local($value) = $listvals{"$ikey"};

$template =~ s/$ikey/$value/gm;
}

print "$template\n";

}

Quote Reply
Re: SSI problem ! In reply to
Hi,

this is the command to execute the script
exec cgi="/cgi-bin/entertainment/movies/reviews/news_reader.pl" -->

it works on one server, but when i tried it on the new server, it gave the lines i posted earlier.

i use .SHTML for pages with SSI command.

Thank you,
Quote Reply
Re: SSI problem ! In reply to
Thanks Eliot, the only problem is that my experience with ASP is very limited, i started using ready mad ASP programs a week ago.

i will try to see if someone can help me modify the script so it would work using ASP.

Thank you for your help ,
Laith
Quote Reply
Re: SSI problem ! In reply to
Laith,

I have been working with ASP pages on a limited basis as well...The misconception of ASP is that you have to use Visual Basic codes...WRONG! You can use almost any scripting language, including Perl and Java Script to create asp files. Also, another problem with the codes you've showed is that the path to Perl is for UNIX servers. You can use a path for Windows like the following:

Code:
#!\perl5//bin//perl

Okay, I am back at the office now.

Here is what you need to make your codes work:

1) Create an asp file, called reader.asp. Use these codes in the file:

Code:
<%@language=perlscript%>
<%
###################################################################
###################################################################
push (@INC, "j:\\laith\\htdocs\\cgi-bin\\entertainment\\movies\\reviews\\");
require "config.pl";



$head="$tempdir\\newshead.plate";
$foot="$tempdir\\foot.plate";
$sorry="$tempdir\\sorry.plate";
$list="$tempdir\\list.plate";

&parse_form;
$ticker=0;


&open_file("DATAFILE","",$datafile);
$read_file ;
&read_template($incoming=$head);


foreach $line (sort(date_sort &read_file("DATAFILE")))
{

# split the fields at the | character
@tabledata = split("\t",$line ,10);
$snuffy="yes";
&check_record;


## BEGIN VIEW


if ($field6 eq "published" ){
$counter++;
&read_template($incoming=$list);

}

}

## END VIEW


close(DATAFILE);


if ($counter==0) {
&read_template($incoming=$no_news);
}

&read_template($incoming=$foot);

exit;


sub read_template {

$field2link=$field2;
$field2link=~ s/ /%20/g;

local (%listvals) = ("!FIELD1!", "$field1", "!FIELD2LINK!", "$field2link", "!FIELD2!", "$field2", "!FIELD3!",
"$field3", "!FIELD4!", "$field4", "!FIVE!", "$five", "!FIELD6!", "$field6", "!FIELD7!", "$field7", "!FIELD8!",
"$field8", "!FIELD9!", "$field9", "!FIELD10!", "$field10", "!FIELD11!", "$field11", "!FIELD12!", "$field12",
"!FIELD13!", "$field13");

local ($template) = "$incoming";
open(TEMPL, "$template") | | print "no file found $template!";
$template = "";

while(<TEMPL> )
{
$template .= $_;
}

close(TEMPL);

for $ikey (keys(%listvals))
{
local($value) = $listvals{"$ikey"};

$template =~ s/$ikey/$value/gm;
}
$output .= "$template\n";
}
%>
<!--- Format your HTML of how you want the file to print --->
<!--- Insert the following code in the spot where you want the output to be printed --->

<%=$output%>

2) Create the file where you want to input this data. Make sure you save it as an .asp file.

3) Put the following code in the spot of the new .asp file where you want to display the output:

Code:
<!--#include virtual="/directory/reader.asp"-->

4) Change the /directory/ to the appropriate directory where you have the reader.asp file located.

If you'd like to see an example of how I have used SSI programming in asp files, go to the following web site:

http://www.coco.cc.az.us/

Reload the page and you will see a new picture, with links, and caption appear. The date is also part of the rotating banner asp file.

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 20, 1999).]
Quote Reply
Re: SSI problem ! In reply to
Ah...Try using .asp extension rather than .shtml. In order for .shtml or .shtm to run on NT, you need to change the Header configurations, which is a pain.

I have SSI files running via .asp files. I am using perlscript as the "language" line in my rotating banner .asp file.

I will try to post my exact codes and how to call the file from another .asp file tomorrow when I have access to my files at the office, okay??

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI problem ! In reply to
Eliot,

i tried what you told me , but im getting this error when i request the ASP page, i did everything as you said :

################################################################### push (@INC, "j:\\jordanmallcom\\htdocs\\cgi-bin\\entertainment\\movies\\reviews\\"); error '80004005'

syntax error, near ") ################################################################### ################################################################### push" syntax error at (eval 10) line 42, near "| |" Bareword found where operator expected at (eval 10) line 57, near ") Response" (Missing operator before Response?) syntax error at (eval 10) line 57, near ") Response" Bareword found where operator expected at (eval 10) line 58, near ") Response" (Missing operator before Response?)

/cgi-bin/entertainment/movies/reviews/reader.asp, line 5


Quote Reply
Re: SSI problem ! In reply to
First of all, you don't really need to have the asp run from your cgi-bin. The paths you have for your file are incorrect. They should be as follows:

Code:
j:/jordanmallcom/htdocs/cgi-bin/entertainment/movies/reviews/

$head="$tempdir/newshead.plate";
$foot="$tempdir/foot.plate";
$sorry="$tempdir/sorry.plate";
$list="$tempdir/list.plate";

Also make sure that the other syntax of the perl codes are accurate...I noticed another line that may be posing problems:

Code:
open(TEMPL, "$template") | | print "no file found $template!";

Make sure that there is no space between &#0124; &#0124;. Also you may want to consider using OR instead of &#0124; &#0124;.

After you have cleaned up the syntax errors, it should work fine. Smile *crossing fingers*

Sorry...I should've been more clear about how to get this to work, including cleaning up your code.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI problem ! In reply to
hi,
i tried but i keep getting this error :

################################################################### push (@INC, "j:/jordanmallcom/htdocs/cgi-bin/entertainment/movies/reviews/"); error '80004005'

syntax error, near ") ################################################################### ################################################################### push" syntax error at (eval 10) line 42, near "| |" Bareword found where operator expected at (eval 10) line 57, near ") Response" (Missing operator before Response?) syntax error at (eval 10) line 57, near ") Response" Bareword found where operator expected at (eval 10) line 58, near ") Response" (Missing operator before Response?)

/cgi-bin/entertainment/movies/reviews/reader.asp, line 5

Quote Reply
Re: SSI problem ! In reply to
Did you take the space out between the two | |?

That seems to be causing the problem.

Other than that, I don't know what to tell ya. I have used SSI cgi scripts within asp files and it has worked fine for me.

Sorry I cannot be more helpful.

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI problem ! In reply to
I'm having the same problem as Laith. when i use SSI(random banner scrip, Show & sell) , I will have this

HTTP/1.1 200 OK Date: Tue, 05 Oct 1999 07:55:53 GMT Server: Microsoft-IIS/4.0 Content-Type: text/html

and, Eliot, I'm interested in ur rotating banner .asp.
Quote Reply
Re: SSI problem ! In reply to
eskimoz,

Are you using .shtml/.shtm file extensions or .asp file extension? Active Server Pages work the best on NT. I have personally tried to add .shtm and .shtml as File Types in my web sites and configured them the same as .asp, but I,too, received HTTP Header errors.
So, the best piece of advice I can offer is to use .asp for NT servers.

If you are interested in my Banner Rotation script, I can send it to you. Keep in mind that it is very simple and quite raw in the sense that it does not have an easy administration interface. You have to edit the asp file everytime you add a new banner.
If you want it, send me an email message to eliot@anthrotech.com.

For simple image rotations on web pages, it works...but in terms of Banner Ads or Banner Exchanges, it is not the best program.

What I would suggest doing (if you want to have an easy admin interface for adding new banners) is check out some ASP sites on the Net. I have a few listed on the following web page:

http://www.coco.cc.az.us/~it/webctr/tools/asp/

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI problem ! In reply to
Hi Eliot, I'm using .shtml for the SSI. U mention that if we wanna get rid of the Header thingy, we need to change the header?How do we goes abt doing that? any url ?
Quote Reply
Re: SSI problem ! In reply to
No, I said that you need to change the extension of the file to .asp and also edit the included file to make that file .asp. I mentioned that I experienced difficulties with .shtml and .shtm files on NT. USE ASP!

(As I mentioned before and also in the example I provided, you can use Perl as the scripting language for .asp files.)

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI problem ! In reply to
hm..so there's no way to solve that problem huh. anyway, I've use Admentor ,using asp for banner rotating.

I still haven solve the email part for dbman! Frown I will use asp database once I know how.
Quote Reply
Re: SSI problem ! In reply to
In terms of the Header problem...No, I have not found a solution yet even with reading many tutorials on Perl for Win32 and NT.

eskimoz, using asp will not solve your email problems with DBMAN...

Again, like I mentioned before, I would recommend using SMTP. If you have Microsoft Exchange Server installed and configured on your server, you can use SMTP to connect via Sockets to the Exchange Server to send email messages via web forms.

(There are Threads in the DBMAN Discussion Forum that discuss using SMTP for email modules.)

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: SSI problem ! In reply to
Regarding Malformed HTTP Request Headers in IIS 4.0, there is a hotfix (patch) offered by Microsoft.

Go to Technet: technet.microsoft.com

Then search for IIS Headers (All Words). There are articles as well as a list of patches.

Important: Remember that you will need to re-install the Option Pack after you install any hotfix or patch for NT. DO NOT INSERT THE NT CD-ROM IF ASKED. Just re-boot the server and re-install the Option Pack after the patch has been applied. This piece of information is not noted in any Microsoft white papers, but I have received this information from a trusted source, our technical support people from our vendor.

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: [Laith] SSI problem ! In reply to
Hi,

We want to add a Server Side Include (SSI)to our default1.shtml page. We have encountered a problem that we are having trouble with.

To include another html page in our shtml page we use the following command:

<!--#exec cgi="/africanosestates/exec/search.cgi?search=1&perpage=1&lfield32_keyword=yes&template=_featured_property.html" -->

the result comes out but with a line of text that I donít want to appear. You can take a look at the page here:

http://www.skwebline.net/...tates/default1.shtml

the text under featured property of the week should not be there, how do you suggest that I get rid of that so it only displays the property page.

------------------------------------

HTTP/1.1 200 OK Date: Mon, 19 Apr 2004 13:48:12 GMT Server: Microsoft-IIS/5.0 Content-type: text/html

-------------------------------------------

our server is a windows 2000 personal server IIS 5.0 and we have setup the server ourselves.

It looks like our web server is pumping out an extra header to the webpage. Generally, header information like that would be hidden and only seen by the web browser and the web server. It may be that there's a duplicate header being generated. However, given that I am not a network administrator, I can't say for sure how to fix that. The SSI code that we are using is definitely the correct code for executing an include on a Windows server.

We have also checked on the server to see if the problem can be fixed but we didnít find anything wrong with the server settings.

Could you please advice us on this.

Thank you for your time