I have a small apache2 CGI application on Ubuntu. CGI handler bash shell script.
My client application search.html :
<html>
<body>
<form action="/cgi-bin/search.sh" method="post">
<input type="text" name="searchKey" size="10"></input>
<input type=SUBMIT value="search">
<form>
</body>
</html>
firstly, I just want to catch the value of the "searchKey" parameter on the server side. I tried to follow but didn't display anything.
search.sh :
#!/bin/bash
echo Content-type:text/plain
echo ""
echo $SEARCHKEY
Guys, can you tell me how to catch the parameter value on the server side?
UPDATE
thank you for all the answers. I realized that to get information about post-processing, you need to read data from STDIN.
I tried since Ithcy will suggest the following:
#!/bin/bash
echo post=$(</dev/stdin)
echo 'content length:'$CONTENT_LENGTH
echo 'content:'$post
he only displayed the following:
content length:30
content:
? Apache, ?