Jump to content

in_array error


Recommended Posts

{
  	$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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.