jonhen
01-17-2012, 10:40 PM
I have this code to prompt for text input and then I want to run script.sh:
<script type="text/javascript">
function runscript()
{
var x=prompt("Enter text:");
//this is where I'm lost
var xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","/cgi-bin/script.sh");
xmlhttp.send()
}
</script>
Is it possible to substitute x above as the value for $txt in script.sh which looks like this below and how please?
#!/bin/bash
echo "Content-type: text/html"
echo ""
<some xmlrpc command> "add text $txt"
:confused:
<script type="text/javascript">
function runscript()
{
var x=prompt("Enter text:");
//this is where I'm lost
var xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","/cgi-bin/script.sh");
xmlhttp.send()
}
</script>
Is it possible to substitute x above as the value for $txt in script.sh which looks like this below and how please?
#!/bin/bash
echo "Content-type: text/html"
echo ""
<some xmlrpc command> "add text $txt"
:confused: