On Wednesday, Feb 5, 2003, at 14:00 US/Pacific, Stephen Spalding wrote:

Hello all,

I've written a cgi page whose form I've set up to open
another window. I'm having problems getting an input
variable to pass from the originating page to the page
that's being opened. I've included some snippits from
my code below. I can't even get it to work in this
simple example.
[..]
print "    <B>Select a year to view:</B>\n";
print "  </TD>\n";
print "</TR>\n";
print "</TABLE>\n";

print "<FORM method=\"post\"
action=\"display_schedule.pl?FULL_SCREEN=true\">\n";
you might want that to be a 'hidden' value' rather than
trying to squirrel it directly as a part of the uri
that is the action.

print "<FORM method=\"post\"action=\"display_schedule.pl\">\n";
print '<input type="hidden" name="FULL_SCREEN" value="true">' . "\n";

also if you use ' marks then you will not interpolate the the "
[..]

print "    <select name=\"year\" size=\"1\">\n";
if ( $year eq '2002' )
[..]
NAME=\"submitButton\" VALUE=\"Go!\"";
print "    onClick=\"open_schedule()\">";
[..]

this worries me... I've had little luck with
invoking onClick portable across browsers


#!/usr/bin/perl
print "Content-type: text/html\n\n";

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
        {
        ($name, $value) = split(/=/, $pair);
        $value =~ tr/+/ /;
        $value =~
s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

        # full_screen eq true
        if ( $name eq 'year' ) { $year = $value; }
        }

[..]

your parser here is reasonable - you should be getting
the

	year=2002&....

you might also try to change the 'post' method to a
get, and see what your browser does with the cgi
what I fear you would be seeing would be

	display_schedule.pl?FULL_SCREEN=true? year=2002

just some thoughts on it.
	


ciao
drieux

---


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to