Need help

Discussion in 'Perl Misc' started by perl newbie, Jun 8, 2006.

  1. perl newbie

    perl newbie Guest

    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.
     
    perl newbie, Jun 8, 2006
    #1
    1. Advertising

  2. 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
     
    Tad McClellan, Jun 8, 2006
    #2
    1. Advertising

  3. perl newbie

    perl newbie Guest

    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
     
    perl newbie, Jun 9, 2006
    #3
  4. 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
     
    Tad McClellan, Jun 9, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TN Bella
    Replies:
    1
    Views:
    2,506
    Edward
    Jun 18, 2004
  2. Teep
    Replies:
    2
    Views:
    787
    Larry Marburger
    Jun 21, 2004
  3. John
    Replies:
    1
    Views:
    431
    John C. Bollinger
    Aug 19, 2004
  4. =?Utf-8?B?Q2hyaXM=?=

    Help Help. I really need some help with this

    =?Utf-8?B?Q2hyaXM=?=, Jan 31, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    601
    =?Utf-8?B?SmFzb24gVmVybWlsbGlvbg==?=
    Jan 31, 2007
  5. ElementX
    Replies:
    9
    Views:
    535
    RedGrittyBrick
    Oct 1, 2008
Loading...

Share This Page