Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - problem with read in a CGI shell script: (1 Item)
   
problem with read in a CGI shell script  
Dear all,

Since last updates of windows, some of my cgi scripts are not working anymore. They are ending with a white page.

I tried to debug as deep as possible, and it seems that the function "read" needed to read the values of my forms 
creates the problem. When I remove the line containing it, the script responds and ends normaly (but without getting the
 form values of course). 

Here follows my scripts (test.htm with the form, and test.cgi that processes the form values) reduced to the simplest 
way to point the problem.

So when I use them with old windows XP or old windows 7, it is working without problem. Since last updates of Windows, 
when I fill the form of test.html and submit them, it ends after a while on a white page.

I tried these 2 same basic scripts on LINUX debian, and there are no problem.

What could be the problem?

#################
#test.html
#################
<html>
<body>
<form method="POST" action="./test.cgi?add2" >
<table>
<TR><TD> name </TD><TD> <input type=text name=test size=17 style='font-family: Courier'><br> </TD></TR>
</table>
<input type=submit value=Submit>
</form>
</body>
</html>

#################
#test.cgi
#################

#!/bin/sh

Q="$QUERY_STRING"
if [ "$CONTENT_LENGTH" != "" ]
then
        read A;
fi

echo "Content-type: text/html"
echo

case "$Q" in
        add2)
          echo "test michele<br>"
          echo "A:"$A"<br>";
          ;;
esac