GroundZeroStudio Posted March 4, 2007 Share Posted March 4, 2007 { $required = array ('newname' , 'newpass' , 'verpass' , 'email' , 'veremail' , 'country'); //LIST OF FIELDS NOT REQUIRED } case "new": foreach($_POST as $field => $value) { if (in_array($field, $required)) //LINE 79 { if ($value == "") { unset($_GET['do']); $message_new = "A Required field entry is missing. Please try again. The Missing Field is $field"; include("login_form.html"); exit(); } } ERROR! Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/.mccoy/wamboldt/ictonentertainment.com/wamboldt/login.php on line 79 i put a comment on line 79. That is the right datatype so what is wrong? Link to comment https://forums.phpfreaks.com/topic/41130-in_array-error/ Share on other sites More sharing options...
simcoweb Posted March 4, 2007 Share Posted March 4, 2007 You're declaring a 'case' which is part of a 'switch' function but no 'switch' is declared. case "new": Link to comment https://forums.phpfreaks.com/topic/41130-in_array-error/#findComment-199214 Share on other sites More sharing options...
GroundZeroStudio Posted March 4, 2007 Author Share Posted March 4, 2007 dude, switch is defined. I have a couple hundred lines of code and didnt want to post them all Link to comment https://forums.phpfreaks.com/topic/41130-in_array-error/#findComment-199223 Share on other sites More sharing options...
Orio Posted March 4, 2007 Share Posted March 4, 2007 I see that you are defining $required as an array inside a block: { $required = array ('newname' , 'newpass' , 'verpass' , 'email' , 'veremail' , 'country'); //LIST OF FIELDS NOT REQUIRED } Is that an "if"? Because if it is, it's probably not entering the block (this condition is false) and that's why $required is not being defined. You need to either make sure that if gets executed all the time, or define $required within the "new" case (or before of it- whats important is that it will be defined). Orio. Link to comment https://forums.phpfreaks.com/topic/41130-in_array-error/#findComment-199230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.