'; if ($thissurvey==false || !tableExists("tokens_{$surveyid}")){ $html .= $clang->gT('This survey does not seem to exist.'); } else { $usquery = "SELECT emailstatus from ".db_table_name("tokens_{$surveyid}")." where token=".db_quoteall($token,true); $usresult = $connect->GetOne($usquery); if ($usresult==false) { $html .= $clang->gT('You are not a participant in this survey.'); } elseif ($usresult=='OK') { $usquery = "Update ".db_table_name("tokens_{$surveyid}")." set emailstatus='OptOut', usesleft=0 where token=".db_quoteall($token,true); $usresult = $connect->Execute($usquery); $html .= $clang->gT('You have been successfully removed from this survey.'); } else { $html .= $clang->gT('You have been already removed from this survey.'); } } $html .= '

'; //PRINT COMPLETED PAGE if (!$thissurvey['templatedir']) { $thistpl=sGetTemplatePath($defaulttemplate); } else { $thistpl=sGetTemplatePath($thissurvey['templatedir']); } sendcacheheaders(); doHeader(); echo templatereplace(file_get_contents("$thistpl/startpage.pstpl")); echo templatereplace(file_get_contents("$thistpl/survey.pstpl")); echo $html; echo templatereplace(file_get_contents("$thistpl/endpage.pstpl")); doFooter(); // Closing PHP tag is intentially left out (yes, it's fine!)