Would someone be willing to do a huge favor for me?
No?.. ok… well… I’ll ask anyay
I’m at school right now and I just typed some php code, problem is that I can’t test it from school. I don’t have access to either ftp or a way to upload it to my server. Well, I actually was able to once but it gave me a 500 Internal Server error (I dont know why). But, will someone please tell me if the following code will work? And if not, why not? Thanks
<?PHP
//Change to your # of Qs
$numOfQuestions = 2;
$theOldQuestion = $_POST('oldQuestion');
$theOldAnswer = $_POST('oldAnswer');
$theOldAnswer = $_POST('yourAnswer');
$theNumber = rand($numOfQuestions,1);
$question1 = "What happened in Italy?";
$answer1 = "Unification.";
$question2 = "Who ruled France?";
$answer2 = "Napoleon III";
$theQuestion = "'$question'.$theNumber";
$theAnswer = "'$answer'.$theNumber";
?>
<html>
<head>
<title>AP European Quiz</title>
</head>
<body>
<b>The Previous Question:</b><br>
<?= $theOldQuestion ?><br><br>
<b>Previous Question's Answer:</b><br>
<?= $theOldAnswer ?><br><br>
<b>Your Answer:</b><br>
<b>Your New Question</b><br>
<?= $theQuestion ?><br><br>
<b>Answer Below</b><br>
<form method="post" action="quiz.php">
<input type="text" name="yourAnswer"><br><br>
<input type="hidden" name="oldQuestion" value="<?= $theQuestion ?>">
<input type="hidden" name="oldAnswer" value="<?= $theAnswer ?>">
<input type="submit" value="answer">
</form>
</body>
</html>