# Help Testing

**URL:** <https://forum.kirupa.com/t/help-testing/42659>\
**Category:** programming\
**Created:** [February 11, 2004, 4:48pm UTC](https://forum.kirupa.com/t/help-testing/42659 "2004-02-11T16:48:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yeldarb](https://avatars.discourse-cdn.com/v4/letter/y/51bf81/32.png) [@Yeldarb](https://forum.kirupa.com/u/Yeldarb)\
**Post date:** [February 11, 2004, 4:48pm UTC](https://forum.kirupa.com/t/help-testing/42659/1 "2004-02-11T16:48:26Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2004, 4:58pm UTC](https://forum.kirupa.com/t/help-testing/42659/2 "2004-02-11T16:58:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2004, 8:36pm UTC](https://forum.kirupa.com/t/help-testing/42659/3 "2004-02-11T20:36:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2004, 9:36pm UTC](https://forum.kirupa.com/t/help-testing/42659/4 "2004-02-11T21:36:33Z")

</div>

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

thanks 🙂

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