Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/data/data/com.termux/files/usr/bin/bash
- echo "Content-type: text/html"
- echo ""
- QUERY=$QUERY_STRING
- IFS="&"
- set -- $QUERY
- array=($@)
- declare -A get_post
- for i in "${array[@]}";do
- IFS="=" ;
- set -- $i;
- get_post[$1]=$2
- done
- QUERY_STRING=$(echo $QUERY_STRING | sed 's/&/ /')
- inp=`echo "${get_post['text']}" | sed 's/+/ /g'`
- cat << EOF
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
- <div class="container">
- <h3>contoh input data dynamic</h3>
- <h4>bash cgi query string</h4>
- <form method="get" class="form-horizontal">
- <div class="form-group">
- <div class="col-sm-10">
- <input name="text" value="$inp"></input>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-10">
- <button class="btn" name="submit" type="submit" value="action" > action </button>
- </div>
- </div>
- </form>
- </div>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
- EOF
- if [ ${get_post["submit"]} == "action" ];then
- printf "<div class=\"col-sm-offset-2 col-sm-10\"><p>anda menulis:</p> \
- <p class="text-success">$inp</p></div>"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement