with cgi refresh webpage if...(in c/c++)
-
hi, does anyone know how i can refresh a webpage only if a certain variable is equal to some value in particular: ex-> int a; //get a from user using scanf if(a==7) //refresh webpage else //printf a message thanks porac69
I wrote a nice long reply originally but accidently closed the damn window... Basically...what I suggested is you to execute to redirects.. Original to temp Temp to original using:
if(a==10){
printf("Location: http://www.domain.com/script2.cgi");
printf("Location: http://www.domain.com/script1.cgi");
}You could maybe try redirecting to the exact same page using the
SCRIPT_NAME
environment variable...if that is what its called...??? You will have to let the browser know not to use it's cached version though with the following headers I stole from a PHP script I have:header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);gmdate() is a PHP function you'll have to find the equivelant in the CRT or library your using... Replace
header(
) withprintf()
HTH Cheers :) How do I print my voice mail?