PDA

View Full Version : trouble reading flash vars in cgi


peteknob
01-15-2003, 12:43 AM
I am having trouble reading variables in my CGI Script that I am passing from a flash document. it is a very simple login tool (not password protected as it is not critical information),

I do not know if there is any necessary installation procedure for subparseform.lib ... perhpas that is my problem.

This is my flash code:

an input text field named "loggery" holds the text, and upon pressing a button this action is run:

on (release) {
getURL("http://www.pmkdesign.net/cgi-bin/log.cgi","", "POST");
}
this is my perl script; but the "elseif" portion is always executed indicating that the $uname variable has not received the info from the flash form. Any Help?

#!/usr/bin/perl

require "subparseform.lib";
&Parse_Form;

$uname = $formdata{'loggery'};

@names=("peteknob","NED");


if ($uname eq $names[0] ) {
print "Location: http://www.pmkdesign.net/\n\n";
} elsif ( $uname eq $names[1]) {
print "Location: http://www.nedev.com\n\n";
} else {print "Location: http://www.pmkdesign.net/index2.html\n\n";

}
Thanks, Pete M. Knob

peteknob
01-15-2003, 01:45 AM
I changed my CGI like so

#!/usr/bin/perl

require "subparseform.lib";
&Parse_Form;

$uname = $formdata{'loggery'};

$rename = $uname;


print "Content-type: text/html\n\n";
print <<ENDHTML;
<html>
<head>
<title>perl tutorial</title>
</head>
<body>
<p>perl tutorial: writing html; $uname $rename</p>
</body>
</html>

ENDHTML

and it displays the vars so they are passing; but it has their font formatted in a light grey, which indicated to me that flash might pass on extra information. I do not know why it passes the variables, but refuses to manipulate them in an if statement as per the previous code (see original message above)