You can set variables using SSI. These would be available to the script if they are set before the script is called:
<!--#set var="widget" value="red" -->
You can also pass environmental variables to the script by prepending a $ character to the env name:
<!--#include virtual=/cgi-bin/example.cgi?ip=$REMOTE_ADDR" -->
Hope this helps.