简体   繁体   中英

How to send a variable form my bash cgi script to my index html page?

I have a homepage ./index.html, and on this page I would like to display a variable that was created in my ./cgi-bin/print_ip.sh file.

What is the cleanest way of accomplishing this?

if you can use shtml, take a look at here https://www.computerhope.com/jargon/s/shtml.htm

shtml is like html where you can dynamicly include some stuff from the webserver:

<!--#exec cmd="cgi-bin/mycounter.cgi" -->
<!--#include virtual="/cgi-bin/mycounter.cgi" -->
<insert file="cgi-bin/mycounter.cgi">
<!--#echo var="DATE_LOCAL" -->

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM