Need help

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.
 
T

Tad McClellan

perl newbie said:
Subject: Need help


Need subject!

Please put the subject of your article in the Subject of your article.

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.)
I don't know how to properly insert the
cgi
script into my html page.


You never insert CGI programs into HTML pages.

CGI programs run on a web *server* (the _output_ of CGI programs
goes to the client (browser)).

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" -->


SSI is not CGI.

(see cgi file below).
Does anyone know the proper perl
syntax to place text where you want on a page and constain it to a
selected area?


You do that the same way regardless of what programming language
you choose to use.

ie. That is not a Perl question (it is an HTML question).



That is not a CGI file.

That resource is the *output* from a CGI program.

We need to see the program's source code if we are to debug it.
 
P

perl newbie

I know you should keep the cgi seperate from your html but I was just
looking for a way to output the result of the cgi script onto my index
page. I actually did that sucessfully, I just don't know how to place
the result exactly where I want it and to constrain it in a certain
area.

I know CGI and SSI are not the same thing. I was just asking if the
fact that I could not "call" my perl script from index using
<!--#include virtual="/cgi-bin/tips.cgi"--> or <!--#exec
cgi="/cgi-bin/tips.cgi" -->was because my temporary host lycos/tripod
doesn't support SSI.

In my cgi file, all I did was to insert my html between the two
PrintTags. You should be able to see all of my source codes by just
visting the addresses and right-clicking.
 
T

Tad McClellan

You should be able to see all of my source codes by just
visting the addresses and right-clicking.


How do you know what my right mouse button is mapped to?



[snip TOFU.
Don't do that unless you want all of your future posts to be invisible.
]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top