Gossamer Forum
Home : General : Perl Programming :

Re: SSI problem !

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).]
Subject Author Views Date
Thread SSI problem ! Laith 13133 Aug 18, 1999, 10:39 AM
Post Re: SSI problem !
Eliot 12859 Aug 18, 1999, 2:52 PM
Post Re: SSI problem !
dan 12859 Aug 18, 1999, 10:38 PM
Post Re: SSI problem !
Laith 12889 Aug 18, 1999, 10:55 PM
Post Re: SSI problem !
Laith 12875 Aug 19, 1999, 9:51 AM
Post Re: SSI problem !
Laith 12860 Aug 19, 1999, 11:40 PM
Post Re: SSI problem !
Eliot 12893 Aug 20, 1999, 7:46 AM
Post Re: SSI problem !
Eliot 12852 Aug 20, 1999, 9:06 AM
Post Re: SSI problem !
Laith 12870 Aug 20, 1999, 10:56 AM
Post Re: SSI problem !
Eliot 12859 Aug 20, 1999, 1:55 PM
Post Re: SSI problem !
Laith 12881 Aug 22, 1999, 10:11 AM
Post Re: SSI problem !
Eliot 12871 Aug 22, 1999, 11:46 AM
Post Re: SSI problem !
eskimoz 12875 Oct 4, 1999, 8:50 PM
Post Re: SSI problem !
Eliot 12892 Oct 5, 1999, 7:24 AM
Post Re: SSI problem !
eskimoz 12997 Oct 5, 1999, 8:58 PM
Post Re: SSI problem !
Eliot 12961 Oct 6, 1999, 4:08 AM
Post Re: SSI problem !
eskimoz 12926 Oct 6, 1999, 10:22 PM
Post Re: SSI problem !
Eliot 12941 Oct 7, 1999, 5:05 AM
Post Re: SSI problem !
Eliot 13063 Oct 7, 1999, 5:14 AM
Post Re: [Laith] SSI problem !
skwebline 12775 Apr 20, 2004, 5:18 AM