P
perl newbie
Hello, I am attempting to build a page that uses a cgi script to
extract info from
a delimited text file database and then place it into an html file for
viewing (see files below.) The database will contain "tips for the
day" and is
arranged in four fields containing the month, day, year, and tip or
event
info (I have "dummy data" in it now.). The script gets the current
date and compares it to the date listed for the tip. If they match it
extracts that record and prints it. I
compare the month and the date but not the year. There is a foreach
loop
used for iteration. My script works well with the sample data that I
have
when the cgi script is run.
I use a WYSIWYG web program called "Webpagemaker." I can draw a box
then
click in it and paste my html content or script in it. I have a
limited
knowledge of cgi and html and I don't know how to properly insert the
cgi
script into my html page. On my html page listed below, I simply typed
in
the result in the box but I want that info generated by the cgi instead
so
that it will change daily. In other words, I need to "marry" the cgi
script
to my html page.
Questions:
1) How might I achieve the aforementioned task? I have tried both
<!--#include virtual="/cgi-bin/tips.cgi"--> and <!--#exec
cgi="/cgi-bin/tips.cgi" -->
With both I get "[an error occurred while processing this directive]"
The only thing I can come up with is maybe lycos/tripod doesn't suport
SSI. When the site is finally finished, it will be hosted on
doteasy.com using a plan that does support SSI..
2) As a second option, I tried to put the html in the cgi page itself
and do everything from it. I get it to output on the page but I don't
knoe how to place the outputted text where I want (see cgi file below).
Also, when I get this to work, I will have to redirect my users form
the index/html page to the cgi page. Does anyone know the proper perl
syntax to place text where you want on a page and constain it to a
selected area?
3) Also, A hard return must be used after each record in the data text
file
according to my understanding of cgi. Using my file, what if I wanted
my
last field (the tips or event field) to contain let's say a recipe for
the
day instead of a tip for the day. The recipe would consist of more
than one
line. How could all of that be grouped together as one unit since
there
would be a hard return for each line of the recipe?
These are my files:
Html page http://dailytips.tripod.com/index.html
Datbase http://dailytips.tripod.com/cgi-bin/data.txt
Cgi file http://dailytips.tripod.com/cgi-bin/tips.cgi
Thank you in advance for any assistance you might offer me.
extract info from
a delimited text file database and then place it into an html file for
viewing (see files below.) The database will contain "tips for the
day" and is
arranged in four fields containing the month, day, year, and tip or
event
info (I have "dummy data" in it now.). The script gets the current
date and compares it to the date listed for the tip. If they match it
extracts that record and prints it. I
compare the month and the date but not the year. There is a foreach
loop
used for iteration. My script works well with the sample data that I
have
when the cgi script is run.
I use a WYSIWYG web program called "Webpagemaker." I can draw a box
then
click in it and paste my html content or script in it. I have a
limited
knowledge of cgi and html and I don't know how to properly insert the
cgi
script into my html page. On my html page listed below, I simply typed
in
the result in the box but I want that info generated by the cgi instead
so
that it will change daily. In other words, I need to "marry" the cgi
script
to my html page.
Questions:
1) How might I achieve the aforementioned task? I have tried both
<!--#include virtual="/cgi-bin/tips.cgi"--> and <!--#exec
cgi="/cgi-bin/tips.cgi" -->
With both I get "[an error occurred while processing this directive]"
The only thing I can come up with is maybe lycos/tripod doesn't suport
SSI. When the site is finally finished, it will be hosted on
doteasy.com using a plan that does support SSI..
2) As a second option, I tried to put the html in the cgi page itself
and do everything from it. I get it to output on the page but I don't
knoe how to place the outputted text where I want (see cgi file below).
Also, when I get this to work, I will have to redirect my users form
the index/html page to the cgi page. Does anyone know the proper perl
syntax to place text where you want on a page and constain it to a
selected area?
3) Also, A hard return must be used after each record in the data text
file
according to my understanding of cgi. Using my file, what if I wanted
my
last field (the tips or event field) to contain let's say a recipe for
the
day instead of a tip for the day. The recipe would consist of more
than one
line. How could all of that be grouped together as one unit since
there
would be a hard return for each line of the recipe?
These are my files:
Html page http://dailytips.tripod.com/index.html
Datbase http://dailytips.tripod.com/cgi-bin/data.txt
Cgi file http://dailytips.tripod.com/cgi-bin/tips.cgi
Thank you in advance for any assistance you might offer me.