You lack a closing curly brace. I don't think na pwede na sa javascript? I'm a beginner pa man sad.
Here is how I would do it:
Code:
<html>
<head>
<title>Mic Test</title>
</head>
<body>
<?php
$sample = new Sample();
if(!$_POST) {
echo 'Do you want to continue ' . $name . '?';
?>
<form method="post">
<input type="checkbox" value="1" name="answer" />
<input type="submit" name="Submit" />
<?php
}
else {
if(isset($_POST['answer']) && $_POST['answer']) {
$sample->save();
} else {
echo 'Okay...';
}
}
?>
</body>
</html>