# Problem with very simple calculating

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on

Hi, I have a quiz with 6 questions and three choices to each of the,
wrong answere is giving the value 0, while correct answere gives the
value 6. The the total is calculated and displayed. My calculation is
here:

\$total = \$_POST["questionone"] + \$_POST["questiontwo"] +
\$_POST["questionthree"] + \$_POST["questionfour"] +
\$_POST["questionfive"] +\$_POST["questionsix"];

each of the questions are with radio buttons:

This is so simple, but still this little script won't calculate! Any
suggestions?
(Yes, I am a really newbie)

## Re: Problem with very simple calculating

Sorry, I messed up.. correct answere gives the vale 1 to each answere.
But still I am as stuck as I could be...

## Re: Problem with very simple calculating

El 08/03/2010 17:57, Nosferatum escribió/wrote:

Does it not calculate in some specific manner you could describe in words?

--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

## Re: Problem with very simple calculating

On 8 Mar, 18:41, "=C1lvaro G. Vicario"

It gives the wrong answere, it doesn't count all the correct answeres
given...

## Re: Problem with very simple calculating

I solved it!

Insted of enclosing in " i replaced them all with '
And that was it.... I don't know why, but I am happy!

## Re: Problem with very simple calculating

Odd, that shouldn't make a difference ... at least as far as I know ...

Datesfat

## Re: Problem with very simple calculating

Also, I can't find anything in the PHP documentation to indicate that " vs.
' should make a difference.

Hmmm ....

http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single

http://www.php.net/manual/en/language.types.array.php

Datesfat

## Re: Problem with very simple calculating

.oO(Datesfat Chicks)

It doesn't in this case, so the problem was definitely somewhere else.

Micha