Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Need help

Reply
Thread Tools

Need help

 
 
perl newbie
Guest
Posts: n/a
 
      06-08-2006
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.

 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      06-08-2006
perl newbie <> wrote:

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


> Cgi file http://dailytips.tripod.com/cgi-bin/tips.cgi



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.


--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
perl newbie
Guest
Posts: n/a
 
      06-09-2006
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.



Tad McClellan wrote:
> perl newbie <> wrote:
>
> > 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).
>
>
> > Cgi file http://dailytips.tripod.com/cgi-bin/tips.cgi

>
>
> 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.
>
>
> --
> Tad McClellan SGML consulting
> Perl programming
> Fort Worth, Texas


 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      06-09-2006
perl newbie <> wrote:


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

--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help, I am intermediate in Java...need help in follow case ElementX Java 9 10-01-2008 08:02 PM
Help Help. I really need some help with this =?Utf-8?B?Q2hyaXM=?= ASP .Net 3 01-31-2007 09:33 PM
re_---need help Network Adapters!!!! NEED HELP!!!! hedayatniac@gmail.com Computer Support 4 08-13-2006 01:03 AM
Need help! I need to add lead zeros to a textbox Teep ASP .Net 2 06-21-2004 01:04 PM
Please help!!! Need datagrid selection to fill textboxes...Need quick!! TN Bella ASP .Net 1 06-18-2004 01:31 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57