ldb358 Posted August 20, 2009 Author Share Posted August 20, 2009 heres the upload script: function upload($maxsize, $upload, $name, $desc){ if(isset($_SESSION['username'])){ $finfo = finfo_open(FILEINFO_MIME, "/usr/share/misc/magic"); $type = finfo_file($finfo, $filename); finfo_close($finfo); if((($type == "image/jpeg") || ($type == "image/pjpeg") || ($type == "image/gif") || ($type == "image/png")) && ($upload['size'] < "104857600") ){ if(strlen($upload['name']) < 60){ if($upload['error'] == 0){ $artistFill = $_SESSION['username']; $newSrc = $artistFill . "/" . $upload['name']; if(!file_exists($newSrc)){ $findArr = array('_', '(', ')', ' '); $nameFill = str_replace($findArr , '' ,$upload['name']); $artistFill = $_SESSION['username']; $sizeFill = (int)$upload['size']; $thisdir = getcwd(); $newdir = $thisdir ."/" . $artistFill; if(!file_exists($newdir)){ mkdir($newdir); } mysql_query("INSERT INTO photos (`id`, `username`, `src`, `name`, `desc`) VALUES ('null', '$artistFill', '$nameFill', '$name', '$desc');") or die(mysql_error()); move_uploaded_file($upload['tmp_name'], $artistFill . "/" . $nameFill); echo "file uploaded"; }else{ echo "file already exists?"; } } }else{ echo "filename is too long please shorten it to under 60 character"; } }else{ echo "invalid file type"; } }else{ home("You must be logged in order to upload an image"); } } and heres the exact error: Fatal error: Call to undefined function finfo_open() in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 536 Link to comment Share on other sites More sharing options...
Maq Posted August 20, 2009 Share Posted August 20, 2009 Clicked "My Profile", and received the following warning: Warning: Missing argument 1 for home(), called in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 202 and defined in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 330 Clicked on a user and received the following warnings: Warning: Missing argument 2 for viewUser(), called in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 72 and defined in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 441 Warning: Missing argument 3 for viewUser(), called in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 72 and defined in /home/vol4/summerhost.info/sum_2677639/lbflash.com/htdocs/functions.php on line 441 Link to comment Share on other sites More sharing options...
darkfreaks Posted August 20, 2009 Share Posted August 20, 2009 those functions only work in PHP 5.3 Link to comment Share on other sites More sharing options...
ldb358 Posted August 20, 2009 Author Share Posted August 20, 2009 to mac that was proboly because i had error reporting on that is fixed and darkfreak i have version 5.2.10 i doubt my host will upgrade what is the replacment? Link to comment Share on other sites More sharing options...
darkfreaks Posted August 20, 2009 Share Posted August 20, 2009 mime-content-type() should work Link to comment Share on other sites More sharing options...
Maq Posted August 20, 2009 Share Posted August 20, 2009 to mac that was proboly because i had error reporting on that is fixed and darkfreak i have version 5.2.10 i doubt my host will upgrade what is the replacment? Maq* Yes, they are merely warnings, which should be fixed, but error_reporting should be turned off on production anyway and set to max during development. Link to comment Share on other sites More sharing options...
ldb358 Posted August 20, 2009 Author Share Posted August 20, 2009 okay maq sorry about the name as about the errors it was on for an emergancey fix only my local server is up to date with version where as host apearaltly is not and to darkfreak it gets the same error hmm... ill have to work on a work around unless my host gets to fixing Link to comment Share on other sites More sharing options...
ldb358 Posted August 20, 2009 Author Share Posted August 20, 2009 okay heres my fix do you see any bugs in this: list($x, $y, $type2) = getimagesize($upload['tmp_name']); $type = image_type_to_mime_type($type2); Link to comment Share on other sites More sharing options...
darkfreaks Posted August 20, 2009 Share Posted August 20, 2009 nope but i can check Link to comment Share on other sites More sharing options...
ldb358 Posted August 20, 2009 Author Share Posted August 20, 2009 i found i bunch of "junk names" in the message database, I'm assuming that meant that in filtered it correctly??? if not what is the particular probleum Link to comment Share on other sites More sharing options...
foliady Posted October 7, 2009 Share Posted October 7, 2009 Your registration script doesn't check if passwords are identical Link to comment Share on other sites More sharing options...
Recommended Posts