PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
So I've got this code that takes an image that is uploaded resizes it and renames it... but it doesnt work properly i know i'm missing something just dont know what...
???m?-Sorry, there was a problem uploading your file.
One thing that I find very useful when writing and debugging code, is to have error messages that are more verbose than what you would have as a finished product and display to your end users. It is very hard to know why your file failed to upload if all it says is 'There was a problem.' What I would do, is put this after your "Sorry, there was a problem uploading your file"..
<pre>
print_r($_FILES);
</pre>
This should tell you any relevant error messages that might have occurred. Specifically the $_FILES['user_image']['error']. If you get an error code, you can look it up here http://us2.php.net/manual/en/features.f ... errors.php as it should tell you exactly what went wrong.
yeah that makes the image upload with the new name but dosent resize the file... thats why i ran it with the $FILENAME1 to try and run the resize first then pass that to the rename part of the code...