Retrieve query_string on my CGI in ksh/html ?

I've this ksh script in my CGI :

SERV_LINUX=$(cat /xxx/xxx/xxx/xxx/xxx/xxx/foo.txt | awk -F';' '{print $2}' | sort | uniq)
    
    DATE_Linux=$(cat /xxx/xxx/xxx/xxx/xxx/xxx/foo.txt | awk -F';' '{print $3}' | sort | uniq)

    echo "<form action="LINUX_GNU.ksh" method="post">"
    echo "<select name="SERV">"
    echo "$SERV_LINUX" | while read SERV_LINUX; do
    echo " <option value="$SERV_LINUX">$SERV_LINUX</option>"
    done
    echo "</select>"
    
    echo "<select name="DATE_Linux">"
    echo "$DATE_Linux" | while read DATE_Linux; do
    echo " <option value="$DATE_Linux">$DATE_Linux</option>"
    done
    echo "</select>"
    
    echo "<input type="submit" value="Select">"
    echo "</form>"
    
     echo "</div>"

This piece of script create a dropdown menu which allow to choose a server. On my second page, If I put this :

read a 
echo $a 

I'm able to retrieve the query string like this :

SERV=my_serv&DATE_Linux=2019-10 

I want to know if it's possible to do the same things but only with button ? I mean, If I've 4 options in my dropdown menu, I would like to create 4 buttons, like that :

SERV_LINUX=$(cat /xxx/xxx/xxx/xxx/xxx/xxx/foo.txt | awk -F';' '{print $2}' | sort | uniq)

echo "<form action="test.ksh" method="post">"
echo "$SERV_LINUX" | while read SERV_LINUX; do
echo "<input type="submit" value="$SERV_LINUX">"
done
echo "</select>"
echo "</form>"
 

One button for each options of the dropdown. When I will click on the button, a new page will open with the result :

SERV=my_serv

But When I try that, I've no result... Do you think it's possible ? Do u have any idea to do this ?

Thanks ! :slight_smile:

try adding names to each button:

echo "<input type="submit" name="server$RANDOM" value="$SERV_LINUX" />"