ansipants Posted October 3, 2011 Share Posted October 3, 2011 when I try to upload the image on submit, I get there following error: Fatal error: Call to undefined function file_extension() in editlogo.php on line 41 Line 41 is the very last line of the code. // get form data, making sure it is valid $img_name = $_FILES['myimage']['name']; $tmp_name = $_FILES['myimage']['tmp_name']; $img_size = $_FILES['myimage']['size']; if ($img_name) { if ($img_size>2097152) { die('Max image size is 2mb!'); } else { $file_ext = file_extension($img_name); Quote Link to comment https://forums.phpfreaks.com/topic/248312-fatal-error-call-to-undefined-function-file_extension/ Share on other sites More sharing options...
Buddski Posted October 3, 2011 Share Posted October 3, 2011 Do you have a function called file_extension? Quote Link to comment https://forums.phpfreaks.com/topic/248312-fatal-error-call-to-undefined-function-file_extension/#findComment-1275093 Share on other sites More sharing options...
ansipants Posted October 3, 2011 Author Share Posted October 3, 2011 well i didn't then I put it in and I got a few errors then i pretty much destroyed the whole thing so, back to the drawing board from scratch :'( Quote Link to comment https://forums.phpfreaks.com/topic/248312-fatal-error-call-to-undefined-function-file_extension/#findComment-1275121 Share on other sites More sharing options...
trq Posted October 3, 2011 Share Posted October 3, 2011 The error is pretty self explanatory. Quote Link to comment https://forums.phpfreaks.com/topic/248312-fatal-error-call-to-undefined-function-file_extension/#findComment-1275126 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.