Skip to content

Commit

Permalink
Added sendcacheheaders prior to each <html> statement. This is to ens…
Browse files Browse the repository at this point in the history
…ure that correct charset is being sent for non latin based surveys

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@894 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Feb 4, 2004
1 parent 4dff00a commit cc6e92f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions group.php
Expand Up @@ -230,6 +230,7 @@
}
else
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand All @@ -244,6 +245,7 @@
//COMMIT CHANGES TO DATABASE
if ($surveyactive != "Y")
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand All @@ -265,6 +267,7 @@
$cookiename="PHPSID".returnglobal('sid')."STATUS";
setcookie("$cookiename", "COMPLETE", time() + 31536000);
}
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -344,6 +347,7 @@
}
else
{//Submit of Responses Failed
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -457,6 +461,7 @@
{
if ($tokensexist == 1 && (!isset($_GET['token']) || !$_GET['token']))
{
sendcacheheaders();
echo "<html>\n";
//NO TOKEN PRESENTED. EXPLAIN PROBLEM AND PRESENT FORM
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand Down Expand Up @@ -499,6 +504,7 @@

if (!$tkexist)
{
sendcacheheaders();
echo "<html>\n";
//TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand Down Expand Up @@ -668,6 +674,7 @@
$_SESSION['fieldarray'][] = array("{$arow['qid']}", "$fieldname", "{$arow['title']}", "{$arow['question']}", "{$arow['type']}", "{$arow['gid']}", "{$arow['mandatory']}", $conditions);
}
}
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -722,6 +729,7 @@
$percentcomplete = makegraph($_SESSION['step'], $_SESSION['totalsteps']);

//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down
10 changes: 10 additions & 0 deletions question.php
Expand Up @@ -213,6 +213,7 @@
}
else //there is no insertarray
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand All @@ -227,6 +228,7 @@
//COMMIT CHANGES TO DATABASE
if ($surveyactive != "Y")
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand All @@ -248,6 +250,7 @@
$cookiename="PHPSID".returnglobal('sid')."STATUS";
setcookie("$cookiename", "COMPLETE", time() + 31536000);
}
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -323,6 +326,7 @@
}
else //submit failed
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -375,6 +379,7 @@
//SEE IF $sid EXISTS
if ($surveyexists <1)
{
sendcacheheaders();
echo "<html>\n";
//SURVEY DOES NOT EXIST. POLITELY EXIT.
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand All @@ -395,6 +400,7 @@
{
if ($tokensexist == 1 && (!isset($_GET['token']) || !$_GET['token']))
{
sendcacheheaders();
echo "<html>\n";
//NO TOKEN PRESENTED. EXPLAIN PROBLEM AND PRESENT FORM
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand Down Expand Up @@ -434,6 +440,7 @@
$tkexist = mysql_num_rows($tkresult);
if (!$tkexist)
{
sendcacheheaders();
echo "<html>\n";
//TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand Down Expand Up @@ -472,6 +479,7 @@
$_SESSION['totalsteps'] = $totalquestions;
if ($totalquestions == "0") //break out and crash if there are no questions!
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -595,6 +603,7 @@
$_SESSION['fieldarray'][] = array("{$arow['qid']}", "$fieldname", "{$arow['title']}", "{$arow['question']}", "{$arow['type']}", "{$arow['gid']}", "{$arow['mandatory']}", $conditions);
}
}
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -926,6 +935,7 @@ function last()
}
}
//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down
10 changes: 10 additions & 0 deletions survey.php
Expand Up @@ -233,6 +233,7 @@
}
else
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand All @@ -248,6 +249,7 @@
//COMMIT CHANGES TO DATABASE
if ($surveyactive != "Y")
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand All @@ -269,6 +271,7 @@
$cookiename="PHPSID".returnglobal('sid')."STATUS";
setcookie("$cookiename", "COMPLETE", time() + 31536000);
}
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -346,6 +349,7 @@
}
else
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -392,6 +396,7 @@
if (isset($_POST['move']) && $_POST['move'] == " "._LAST." " && !$notanswered)
{
//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -431,6 +436,7 @@
//SEE IF $sid EXISTS
if ($surveyexists <1)
{
sendcacheheaders();
echo "<html>\n";
//SURVEY DOES NOT EXIST. POLITELY EXIT.
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand All @@ -451,6 +457,7 @@
{
if ($tokensexist == 1 && (!isset($_GET['token']) || !$_GET['token']))
{
sendcacheheaders();
echo "<html>\n";
//NO TOKEN PRESENTED. EXPLAIN PROBLEM AND PRESENT FORM
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand Down Expand Up @@ -492,6 +499,7 @@

if (!$tkexist)
{
sendcacheheaders();
echo "<html>\n";
//TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
foreach(file("$thistpl/startpage.pstpl") as $op)
Expand Down Expand Up @@ -530,6 +538,7 @@
$totalquestions = mysql_num_rows($result);
if ($totalquestions == "0") //break out if there are no questions!
{
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down Expand Up @@ -675,6 +684,7 @@
}

//READ TEMPLATES, INSERT DATA AND PRESENT PAGE
sendcacheheaders();
echo "<html>\n";
foreach(file("$thistpl/startpage.pstpl") as $op)
{
Expand Down

0 comments on commit cc6e92f

Please sign in to comment.