Re: Need help



In article <1149798833.544921.327520@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
perl newbie <antwonmedford@xxxxxxxxxxx> wrote:

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.

If you are having a problem with your Perl script and want help, you
should post a version here that is short-as-possible but still
demonstrates the problem. However, you say your script works well.


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.

You do NOT want to insert your CGI script into your HTML page. You
should keep the two separate for now. Your HTML page gets sent to the
client browser. The CGI script is executed on the server and it MUST
generate a valid HTTP response, usually an HTML page (containing only
HTML tags and text, but NO CGI script!)

Normally, you will have a static HTML page with a form linked to a CGI
script. Submitting that form to the server results in the CGI script
being executed, and the CGI script generates another HTML page (with
your tip of the day, for example), which gets returned to the client
browser as a response to the form submittal.

Once you learn CGI, you can think about using one of the many HTML
template methods that allow you to intermix CGI scripts and HTML in a
single file. However, the scripting parts still get executed by the
server, and the HTML sent to the client contains no CGI script code.

Alternatively, you can use PHP, with PHP code embedded in an HTML file.

There are many websites and books that teach people how to program CGI,
sometimes in Perl. Get one as soon as possible. I don't have any good
links at hand. Start with <http://learn.perl.org> if nothing else.

Try "CGI Programming with Perl", Gueilich, et. al., O'Reilly

<http://www.bookpool.com/.x/SSSSSS_C200/sm/1565924193>
<http://safari.oreilly.com/?XmlId=1-56592-419-3>

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.



Relevant Pages

  • Cant make this page work
    ... I can't make this script work properly. ... The script at the bottom of the html page ... Does someone have a perl ... sub output_trace_headers { ...
    (comp.lang.javascript)
  • Re: How to write to drive A: from CGI Perl
    ... >> If that does not look weird to you, then please go back to basics. ... Please (assuming that the quoted text is an actual excerpt from the HTML ... You will have a better version of Perl? ... for HTML or Perl or CGI or anything. ...
    (comp.lang.perl.misc)
  • Re: start_table problem
    ... Fabian Pilkowski wrote: ... and end_tag_name functions are not generated automatically when you use CGI. ... when using ActiveState's Perl all these informations are ... already available in HTML format. ...
    (comp.lang.perl.misc)
  • Re: revisiting web development in Perl...where to start?
    ... the Perl CGI book since 2000! ... I write web based front ends for databases for a living. ... writing scripts as standard CGI scripts. ... I write an HTML module that contains templates for my ...
    (comp.lang.perl.misc)
  • Re: How to pass info to a CGI program without using a form?
    ... The image on the html page is specified by this html code: ... simply doing something like <url of CGI script>?key and check for the value ... and your script will find what key is there: ...
    (perl.beginners)