I’m getting this error:
Warning: stristr() expects parameter 1 to be string, array given in
/nfs/c09/h03/mnt/12345/domains/mydomainname.com/html/inyoni/fabrics.php
on line 385
from this code:
foreach ($_POST as $field => $value) {
if ($value && (stristr($value,"Content-Type: "))){
header("Location: error.php");
exit;
}
}
and I have no idea why. In fact, I don’t see the error, but my client does. My understanding is that this happens when an image file was included in the form (however, this error didn’t appear before, only now).
The site is hosted on Mediatemple and a PHP notification had been sent out to customers about the time this started about PHP5 being used across the board on their servers–is this a PHP5 conflict or something?
A bit puzzled–any help appreciated!
The error is pretty clear. It’s saying that the first parameter of
stristr()has to be a string. However, you’re supplying an array instead which is why the code produces an error. To fix it, simply make sure you’re just checking for string values.