Hi, I have a script that creates a web page, and I put a send button on it. When the user clicks, it opens another script giving a confirmation message that the message was sent, and I want it to write data that was hopefully sent.

So this is a 2 part question.

First, do I need to prepare my data in any way to get it to send correctly?
Second, How do I retreive it correctly, I am using the $ENV to do it, but it does't work.

Here is the form I create:

<TITLE>B.O.B. Question Submission</TITLE> <BODY BGCOLOR=\"#FFFFFF\"><font face=\"Arial\" size=\"3\"> <center><b><h2><font face=\"Comic Sans MS\">Check over data and if inc +orrect or in need of changes <br>Click on the BACK button <br>If correct, click on Send on the bottom of the page</font></H2></b +></center> <hr> <form action="bob_submitq.pl" method="POST"> Date: <b><i>$date</i></b> <br><hr> <p>This Question will possibly be for: <p><b><i>$round_data</i></b> <hr> <font face=arial size=8pt> <TABLE border=0 cellpadding=0> <tr> <td align=right size=8pt>Submitting Library:</td> <td align=left size=8pt> <b><i>$library</i></b></td> </tr> <tr> <td align=right>Submitting Initials:</td> <td align=left> <b><i>$initials</i></b></td> </TR> <tr> <td align=right>Category:</td> <td align=left> <b><i>$category</i></b></td> </TR> <tr> <td align=right>Type:</td> <td align=left> <b><i>$type</i></b></td> </tr> </TABLE> </font> <h3>$category Book and Author Info</h3> <p>$space20<b><i>$book_author</i></b> <h3>Question and Answers</h3> <p>$space20 Question: <b><i>$question</i></b> <p>$space20 $space20 Answer: $round_answer <p>$space20 Page Number: <b><i>$pagenum</i></b> <p>$space20 Changes: <b><i>$changes</i></b> <p>File Name: <b><i>$datefile</i></b> <p>Data Line: <b><i>$datajoin</i></b> <p>E-mail list: <b><i>$email_list</i></b> <p>$errorcat_desc<hr> <center><input type=submit value=Send name=S1> </center></form> </font></body></html>
The File Name and Data line data is what I want, but I want to make them hidden, it is shown for testing purposes. Here is my second script:
#!/usr/bin/perl -wT # Created - by Joseph Ruffino 08/13/04 use CGI::Carp qw(fatalsToBrowser); # Errors are displayed in the web +browseer use CGI qw(:standard :html3); # For HTML output ###################################################################### +######### # Load in variables from form # my $datefile = $ENV{'datefile'}; my $datajoin = $ENV{'datajoin'}; #open (BOBIN, ">>$datefile") || die "Cannot Open File $datefile for wr +iting: $!"; #print BOBIN $datajoin; my $query = new CGI; print $query->header( "text/html" ); print <<END_WEB; <head><TITLE>Question Confirmation</TITLE></head> <BODY BGCOLOR=\"#FFFFFF\"> <center> <p>Data File: $datefile <p>Data Line: $datajoin <b><font face=\"Comic Sans MS\" size=\"5\"> <p>Your <p>Question and Answer <p>has been submitted to Youth <form action=http://www.gailborden.info/services/bob/rules.htm +l> <p>Click to <input type=submit value=Go name=go> back to Q +uestion Submiission Form </center></form> </center></font></body></html> END_WEB close(BOBIN);

Any help would be greatly appreciated. Midnite

Joseph A. Ruffino
Automated Systems Assistant
Gail Borden Public Library District
270 N. Grove Ave
Elgin, Il, 60120
847-742-2411 x5986

janitored by ybiC: Balanced <readmore> tags around longish codeblock, to reduce scrolling in SoPW


In reply to Sending Data by Midnite

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.