Re: Need help
- From: Jim Gibson <jgibson@xxxxxxxxxxxxxxxxx>
- Date: Thu, 08 Jun 2006 16:13:39 -0700
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
.
- References:
- Need help
- From: perl newbie
- Need help
- Prev by Date: Re: Need help
- Next by Date: Re: Binding array to pattern
- Previous by thread: Re: Need help
- Next by thread: Re: Need help
- Index(es):
Relevant Pages
|