! example2.sqr ! !edit the following to match your environment #define TMP_PATH /sqr/cgi-lib/ ! This program can accept a large number of parameters. #define CGI_PARAM_SIZE 1000 ! This include file contains all the routines necessary to ! accept input from CGI #include 'cgi-lib.sqh' begin-program move #sqr-pid to $sqr-pid 888888 string 'tmp/example2_' $sqr-pid '.pdf' by '' into $rpt_name string '{TMP_PATH}' $rpt_name by '' into $rpt_url new-report $rpt_name ! I don't call PrintHeader in this program because I plan to ! redirect the browser to the output of the report. do ReadParse(#num_vars) ! This procedure reads the CGI parameters ! and stores them in CGI_Params do ReadCookies(#num_cookies) do GetCookie('FIRST_EXAMPLE', $first_example) if $first_example = '' do SetCookie('FIRST_EXAMPLE', 'example2.sqr', '', '', '', '') end-if print 'List of CGI Parameters' (1,1) move 0 to #count while #count < #num_vars get $name $value from CGI_Params(#count) name value print $name (+1,1) print $value (,20) add 1 to #count end-while if $first_example != 'example2.sqr' and $first_example != '' print 'Why did you run ' (+2,1) print $first_example () print ' first?' () end-if new-report 't.t' ! This closes the report file do Redirect($rpt_url) end-program