Ok, I've included alot of bad things in my internal user form. The html link starts a popup with frames. Each frame is configured to utilize a cgi (perl) script to perform a certain action on a remote server via a socket connection. After the action is performed the cgi script queries for the current setting and then reposts it back to the <FORM> on the popup frame document. This all works great at the moment however it doesnt scale.
Heres my example.
<skip the socket code>
read ($socket,$buf,5);
my($value) = $buf =~ /(\d+)/;
#setup the values
$SLOW=1;
$FAST=2;
$MEDIUM=3;
if ($value == $SLOW) {
print "Content-type: text/html \n\n";
print <<END;
<html>
<FORM ACTION="/cgi-bin/chng.pl" METHOD="POST">
<h6> Value: <SELECT NAME="Value" </h6>
<OPTION VALUE="1">Slow
<OPTION VALUE="2">Fast
<OPTION VALUE="3">Medium
</SELECT>
<INPUT TYPE="SUBMIT" VALUE="UPDATE">
</FORM>
</body>
</html>
END
}
elsif ($value == $FAST) {
print "Content-type: text/html \n\n";
print <<END;
<html>
<FORM ACTION="/cgi-bin/chng.pl" METHOD="POST">
<h6> Value: <SELECT NAME="Value" </h6>
<OPTION VALUE="2">Fast
<OPTION VALUE="3">Slow
<OPTION VALUE="1">Medium
</SELECT>
<INPUT TYPE="SUBMIT" VALUE="UPDATE">
</FORM>
</body>
</html>
END
}
More code here deleted for size .. ends with an else statement.
See in the above example if the value is 1 it prints the option list back as 1 2 3. If the value is 2 it prints it back as 2 3 1. This all works but is really inefficient since the next frame has a pulldown with about 1000 options. I really dont want to repeat an if elsif elsif elsif 1000 times and include the html in each, is there a more efficient way to take the input, and push it back to the form that i have embedded in the frame page?
tia
inforeqd
Heres my example.
<skip the socket code>
read ($socket,$buf,5);
my($value) = $buf =~ /(\d+)/;
#setup the values
$SLOW=1;
$FAST=2;
$MEDIUM=3;
if ($value == $SLOW) {
print "Content-type: text/html \n\n";
print <<END;
<html>
<FORM ACTION="/cgi-bin/chng.pl" METHOD="POST">
<h6> Value: <SELECT NAME="Value" </h6>
<OPTION VALUE="1">Slow
<OPTION VALUE="2">Fast
<OPTION VALUE="3">Medium
</SELECT>
<INPUT TYPE="SUBMIT" VALUE="UPDATE">
</FORM>
</body>
</html>
END
}
elsif ($value == $FAST) {
print "Content-type: text/html \n\n";
print <<END;
<html>
<FORM ACTION="/cgi-bin/chng.pl" METHOD="POST">
<h6> Value: <SELECT NAME="Value" </h6>
<OPTION VALUE="2">Fast
<OPTION VALUE="3">Slow
<OPTION VALUE="1">Medium
</SELECT>
<INPUT TYPE="SUBMIT" VALUE="UPDATE">
</FORM>
</body>
</html>
END
}
More code here deleted for size .. ends with an else statement.
See in the above example if the value is 1 it prints the option list back as 1 2 3. If the value is 2 it prints it back as 2 3 1. This all works but is really inefficient since the next frame has a pulldown with about 1000 options. I really dont want to repeat an if elsif elsif elsif 1000 times and include the html in each, is there a more efficient way to take the input, and push it back to the form that i have embedded in the frame page?
tia
inforeqd