我有此代码:
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="test/html"; charset=UTF-8">
<title> CLUSTER GRAPH </title>
<h1> Cluster Graph </h1>
<hr size="4" color="blue">
</head>
<body>
<p> Choose a Cluster and press the button to generate the graph ! </p>
<form action="script_extract.sh">
<select name="cluster" >
<option value="Cluster_ALE01">CLUSTER 1</option>
<option value="Cluster_AMR01">CLUSTER 1</option>
</select>
<br><br>
<input type="submit" value="Generate">
</form>
</body>
</head>
</html> '
您能告诉我如何恢复在列表框中选择的值以在新页面中找到她吗?
例如,我想打开一个新标签(例如,我知道如何做到这一点没有问题),例如句子
"Cluster chosen : *Cluster choose in my list box*
如何在我选择集群的第一页和打开并显示句子“选择集群:*在列表框中选择集群”之间的页面之间创建链接?
谢谢! :)
答案 0 :(得分:0)
将method = GET放入表格中。
script_extract.sh需要:
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo '<html>'
echo '<head>'
if [ -z "$QUERY_STRING" ]; then
exit 0
else
saveIFS=$IFS
IFS='&'
eval $QUERY_STRING
IFS=$saveIFS
fi
echo "$cluster
PS:某些配置仅接受.cgi文件。参见httpd.conf或apache.conf