[*FIXED*] Issue with in_array() [strange] 10-28-2013, 09:12 PM
#1
Hi there!
@Illusion and I have been working on fixing this but we can't get it fixed for some reason
the only line that messes with me is this line:
the #stuff is used as connection with the database
above this if statement I've got these codes:
-thanks to illusion
- thanks to illusion to check never thought about this...
the error:
out put of the debugging:
I hope some one could help me out of this strange issue(s) because it's really needed
Thanks for taking your time looking at this forsure and if you could help me please do it.
Regards,
hellomen
@Illusion and I have been working on fixing this but we can't get it fixed for some reason
the only line that messes with me is this line:
PHP Code:
if (in_array(strtolower($_FILES['image']['type']),$extensions)){
#stuff
}else{
echo('Please upload a correct image using one of the following extention(s): <strong>'."$newStrExtentions".'</strong>');
}
above this if statement I've got these codes:
PHP Code:
$extentions = array('image/jpg','image/jpeg','image/gif');
PHP Code:
if ($_FILES['image']['error']){
$errors = array(
0=>"There is no error, the file uploaded with success",
1=>"The uploaded file exceeds the upload_max_filesize directive in php.ini",
2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form",
3=>"The uploaded file was only partially uploaded",
4=>"No file was uploaded",
6=>"Missing a temporary folder" );
die("<b>There was an error:</b> <br/>".$errors[$_FILES['image']['error']]);
}
PHP Code:
echo('Debugging:<br/>File(s): ');
var_dump($_FILES);
echo('<br/>Extention(s): ');
var_dump($extentions);
echo('<br/>');
the error:
Code:
Warning: in_array() expects parameter 2 to be array, null given in /home/u220540669/public_html/index.php on line 40out put of the debugging:
Code:
File(s): array(1) { ["image"]=> array(5) { ["name"]=> string(34) "mta-screen_2013-03-28_12-15-33.png" ["type"]=> string(9) "image/png" ["tmp_name"]=> string(14) "/tmp/phpO6nI5F" ["error"]=> int(0) ["size"]=> int(939906) } }
Extention(s): array(3) { [0]=> string(9) "image/jpg" [1]=> string(10) "image/jpeg" [2]=> string(9) "image/gif" }I hope some one could help me out of this strange issue(s) because it's really needed
Thanks for taking your time looking at this forsure and if you could help me please do it.
Regards,
hellomen
(This post was last modified: 10-30-2013, 04:09 AM by boby79simon.)

![[Image: 120x240.gif]](http://www.gomezpeerzone.com/wp-content/uploads/2011/11/120x240.gif)
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
