syntax error, unexpected $end
Posted: Sun Apr 06, 2008 9:25 am
Hey again group,
I've got this error now and I've gone through and fixed up a few of the {} encapsulation errors I've made, but can't see any more that PHP is telling me there is... can anyone else see it?
Oh man, if anyone can help me get this page to finally show will be my hero!
Cheers,
Jess.
I've got this error now and I've gone through and fixed up a few of the {} encapsulation errors I've made, but can't see any more that PHP is telling me there is... can anyone else see it?
Code: Select all
<?php
// this starts the session
session_start();
?>
<HTML>
<HEAD>
<link rel="stylesheet" type="Text/css" href="/stdtheme.css" />
</HEAD>
<?php
If (isset($Page)) {
If ($Page > 2) {
$to = "<email>";
$subject = "<subject>";
$txt = "<txt>";
$header = "<from>";
mail($to,$subject,$txt,$headers);
echo "Thanks for participating. Your results have now been emailed.";
exit("Goodbye");
}
elseif ($Page > 1) {
$questions = split(':', $_POST["QuestionID"]);
foreach ($questions as $id) {
$_SESSION["answers"] .= $id . ":" . $_POST['$id'] . "#";
}
}
writeQandA($Page);
echo '<A HREF=/"<address>?page=&' . ($Page + 1) . '/">';
echo "Next Page</A>";
}
else {
echo "Welcome....<BR><BR>";
echo '<A HREF=/"http://testing.logisofttech.com/index.php?page=1 . '/">';
echo 'Begin!<' . $chr(47) . 'A>';
}
function writeQandA($page)
{
echo '<FORM Action=\"<address>\" Method=\"POST\">';
If ($page = 1) {
echo 'Question 1: ';
echo 'This will be multiple choice, on page 1';
echo '<HR>';
echo '<TABLE>';
echo '<TR>';
echo '<TD>';
echo '1:';
echo '<input type=\"checkbox\" name=\"0\" value=\"1\">';
echo 'First answer to multiple';
echo '<' . $chr(47) . 'TD>';
echo '<TD>';
echo '2:';
echo '<input type=\"checkbox\" name=\"0\" value=\"2\">';
echo 'Second Answer to multiple';
echo '<' . $chr(47) . 'TD>';
}
If ($page = 2) {
echo 'Question 2: ';
echo 'This will be a single, on page 2';
echo '<HR>';
echo '<TABLE>';
echo '<TR>';
echo '<TD>';
echo '1:';
echo '<input type=\"radio\" name=\"1\" value=\"1\">';
echo 'This is the answer to the single q.';
echo '<' . $chr(47) . 'TD>';
echo '<TD>';
echo '2:';
echo '<input type=\"radio\" name=\"1\" value=\"2\">';
echo 'This is the next answer to the single';
echo '<' . $chr(47) . 'TD>';
}
echo '<' . $chr(47) . 'TABLE>';
echo '<input type=\"hidden\" name=\"QuestionID\" value=\"' . '1:3' . '\">';
echo '<' . $chr(47) . 'FORM>';
}
?>
</HTML>Cheers,
Jess.