Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //return > 0 is ok!
- function _fileinput($name) {
- var_dump($name);
- $input['arquivo'] = $_FILES["$name"]["name"];
- $input['arquivo'] = strtolower(str_replace("h","",$input['arquivo']));
- $input['mimetype'] = $_FILES["$name"]["type"];
- $input['temp'] = $_FILES["$name"]["tmp_name"];
- $input['mimetypes'] = array("image/jpeg", "image/png");
- $input['extencoes'] = array(".jpg", ".jpeg", ".png");
- $input['extencao'] = strtolower(end(explode(".",$input['arquivo'])));
- $input['mimetype'] = strtolower($input['mimetype']);
- $input['novo'] = "[fi]"."[".date('Y-m')."]"."[".strtolower($name)."]"."[".rand(1000,9999)."]".".".$input['extencao'];
- var_dump($input);
- $x = 0;
- if ((array_search($input['extencao'], $input['extencoes']) !== FALSE) AND (array_search(mimetype, $input['mimetypes']) !== FALSE)) {
- $x++;
- }
- else {
- $x = 0;
- }
- var_dump($x);
- list($largura, $altura) = getimagesize($input['temp']);
- if ($largura == "" || $altura == "") {
- $x = 0;
- }
- else {
- $x++;
- }
- var_dump($x);
- if ($x == 2) {
- return $input['novo'];
- }
- else {
- return 0;
- }
- var_dump($x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement