Hi Folks. I have run into a wall and would appreciate any assistance.
I have the following code:
sub parse_form {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
if ( $ENV{'REQUEST_METHOD'} ne "POST" ) {
@values = split(/=/,$ENV{'QUERY_STRING'});
@RquizID = split(/&/,$values[1]);
$quizID = @RquizID[0];
} else {
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
$allow_html = 1;
if ($allow_html != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
else {
unless ($name eq 'new_paragraph' || $name eq 'prescription') {
# $value =~ s/<([^>]|\n)*>//g;
}
}
$FORM{$name} = $value;
}
$quizID = $FORM{'quizID'};
}
}
The ENV variables are as follows:
SERVER_SOFTWARE: Apache/1.3.9 (Unix) (Red Hat/Linux) PHP/3.0.8
GATEWAY_INTERFACE: CGI/1.1
DOCUMENT_ROOT: /mnt/internet_dev/Sites
SERVER_PROTOCOL: HTTP/1.0
SERVER_SIGNATURE:
REQUEST_METHOD: POST
HTTP_REFERER:
http://www.epgnewmedia.com/School%20Redesign/www.mhschool.com/student/scienc
e/mhscience/cgi-bin/quiz.cgi?quiz=1&path=/student/science/mhscience/5/review
/index.html&vGrade=5&vUnit=A&vChapter=1&vLesson=1
QUERY_STRING:
HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)
PATH: /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
*/*
HTTP_ACCEPT_LANGUAGE: en-us
SCRIPT_NAME: /School
Redesign/www.mhschool.com/student/science/mhscience/cgi-bin/quiz.cgi
SCRIPT_FILENAME: /mnt/internet_dev/Sites/School
Redesign/www.mhschool.com/student/science/mhscience/cgi-bin/quiz.cgi
HTTP_PRAGMA: no-cache
SERVER_NAME: www.epgnewmedia.com
REQUEST_URI:
/School%20Redesign/www.mhschool.com/student/science/mhscience/cgi-bin/quiz.c
gi
SERVER_PORT: 80
CONTENT_TYPE: application/x-www-form-urlencoded
CONTENT_LENGTH: 242
Now, I am passing in the variables via a form with hidden fields but they
are not showing up in the QUERY_STRING. Are they supposed to? and if the
STDIN reads the CONTENT_LENGTH, i can't figure out where it actually gets
data to perform the split on.
help??
Thanks in advance.
Brian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]