comparing a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a quiz where the ansers are held in a array called $correct answers. 
When I compare the string

if  ($_REQUEST['x']= $correct_answers[$page-1]) {



with a double == the answer is always correct with the single = it is always 
wrong.

when I echo out the posted answer and the value from the answers arrray they 
are correct.


echo "post equals".$_POST['x']."     corect answer 
is".$correct_answers[$page-1];

Ross 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux