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:
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).]