Help Testing

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 :smiley:


//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";



<title>AP European Quiz</title>

<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">


Notice: Array to string conversion in c:\easyphp1-7\www\quizz\quizz.php on line 6

Fatal error: Call to undefined function: array() in c:\easyphp1-7\www\quizz\quizz.php on line 6

PHP Version 4.3.3

I guess instead of using $_POST(…), use $_POST[…], which is how you would access an array

heh, whoops, didn’t even notice that i used () instead of []

thanks :slight_smile:

and thank you eyezberg for helping me out :slight_smile: :thumb: