When you perform the test you want to know if the $id is the user's 
choice and if the user's choice is in the array.

Your code reads differently. You are checking to see if $id is the 
user's choice OR $id is in the array. which would always check the 
countries in the array.

>                       if(($id == $register_country_of_origin) ||
(in_array($id, $european_union))) {

try this ...

>                         if(($id == $register_country_of_origin) ||
(in_array($register_country_of_origin, $european_union))) {


jim

>
>                 $european_union = array('24', '17', '1', '58', '74', '80',
>'73', '83', '101', '103', '119', '144', '164', '186', '193', '212');
>                 print_r($european_union);
>
>                 if(mysql_num_rows($europe_result) > 0) {
>
>                     while(list($id, $country) =
>mysql_fetch_array($europe_result)) {
>
>                         if(($id == $register_country_of_origin) ||
>(in_array($id, $european_union))) {
>
>                             echo"\t<TD WIDTH=\"50%\"
>CLASS=\"pofgreencard\"><INPUT TYPE=\"checkbox\" NAME=\"country_id[]\"
>VALUE=\"$id\" CHECKED> $country</TD>\n";
>
>                         } else {
>
>                             echo"\t<TD WIDTH=\"50%\"
>CLASS=\"pofgreencard\"><INPUT TYPE=\"checkbox\" NAME=\"country_id[]\"
>VALUE=\"$id\"> $country</TD>\n";
>
>                         }
>                 }
>

-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to