grats
2012-05-31 02:25:48
Well I have an array of 0, 1, 2, 3, 4 files (5 files total) that people can upload
[PHP]if ((($_FILES["attach"]["type"] == "application/pdf")
|| ($_FILES["attach"]["type"] == "application/msword")
|| ($_FILES["attach"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
&& ($_FILES["attach"]["size"] < 8388608))[/PHP]
I am not sure how to use the foreach with $_FILES (don't link me, I already tried some stuff I read on php.net etc and failed to integrate it with my script) I was just wondering how to check the entire array with that instead of doing something like:
[PHP]if ((($_FILES["attach"]["type"][0] == "application/pdf")
|| ($_FILES["attach"]["type"][0] == "application/msword")
|| ($_FILES["attach"]["type"][0] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
&& ($_FILES["attach"]["size"][0] < 8388608))[/PHP]
for 0.. and then obviously adding 1,2,3,4 in there too
thanks
[PHP]if ((($_FILES["attach"]["type"] == "application/pdf")
|| ($_FILES["attach"]["type"] == "application/msword")
|| ($_FILES["attach"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
&& ($_FILES["attach"]["size"] < 8388608))[/PHP]
I am not sure how to use the foreach with $_FILES (don't link me, I already tried some stuff I read on php.net etc and failed to integrate it with my script) I was just wondering how to check the entire array with that instead of doing something like:
[PHP]if ((($_FILES["attach"]["type"][0] == "application/pdf")
|| ($_FILES["attach"]["type"][0] == "application/msword")
|| ($_FILES["attach"]["type"][0] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
&& ($_FILES["attach"]["size"][0] < 8388608))[/PHP]
for 0.. and then obviously adding 1,2,3,4 in there too
thanks