dreamerdevos Posted December 1, 2007 Share Posted December 1, 2007 I have tried a lot of things. The lines of code; $file_name1=$_FILES["image"]["name"]; $ext = strtolower(end(explode('.', $file_name1))); if($ext!="jpg"&&$ext!="jpeg"&&$ext!="png"&&$ext!="tif"&&$ext!="gif") The middle line being the line that is in "error" gets this error when trying to upload a picture, Fatal error: Only variables can be passed by reference $ext = strtolower(end(explode('.', $file_name1))); My guess is that it has to do with the version of php my hosting company has. Can anyone suggest or come up with code that would work on the latest version of php. my guess is its the end and explode that it has a problem with. Also when I change the code to just $ext = strtolower('.', $file_name1); I get an error about the '.' :-\ ??? any help would make my me Quote Link to comment Share on other sites More sharing options...
toplay Posted December 1, 2007 Share Posted December 1, 2007 The end() function requires a variable to be specified as an argument. $file_name1=$_FILES["image"]["name"]; $ext = explode('.', $file_name1); $ext = strtolower(end($ext)); ... See: http://us2.php.net/manual/en/function.end.php Quote Link to comment 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.