I don't know much about web programming and I would really appreciate the help on this.
I have an HTML page that has an input field:
<input type="text" size=20 />
I want to run a CGI script that will return a value so that I can put it in the input field as a default when the page first loads.
So it would look like this I guess:
<input type="text" size=20 value=Run CGI script />
The script is a shell script that I named hostname.cgi and it contains the following:
#!/bin/sh
printf "Content-type: text/html\n\n"
printf $REMOTE_ADDR
When I try using
value=<!--include virtual="hostname.cgi" -->
I get an error on the HTML page that says an error occurred while running this directive (or something like that).
What am I doing wrong? Also, the script is in the same directory as the html file. Other CGI scripts on the page work just fine.