And you did not even have a research for this very specific, already millionfold answered error message? Just stop using undefined indexes, check them with isset before.
… I don’t… this code shouldnt even compile. what is the second set of braces for? What do they attach to? Why are we redefining $images outside of the if?
Do you have separate form fields, one for text or similar type and another for the upload file, but both called “images”? That seems to work in my quick test, but I can’t see that it’s a very good idea.
If you don’t, then you’re not testing the same things. If your only input called “images” is your “type=file” input, then it won’t appear in $_POST.
That’s why my post is in <offtopic> - meaning I’m replying to something in the thread somebody said, not to your question, but still might be interesting.
OK, then your code makes less sense. If the $_POST variable is set, then you assign it to $images. Then, regardless of whether it was set or not, you overwrite $images with another value, without checking whether it exists or not. What’s the point of the first assignment if you’re going to immediately overwrite it?
I was thinking the exact same thing. The whole logic doesn’t make sense. If the logic is supposed to be for uploading a file and allowing the file to have a description, then the way you are going about it is wrong. Like droopsnoot says, you overwrite the value of whatever gets posted with the uploaded file’s name. They both should have different variables. If this isn’t your intention, then having a field for posting makes no sense. If this is supposed to be for uploading only files, then it makes no sense to use $_POST.
I am going to advise you on something critical that can save you and other headaches. Before you want to make any new files or new ideas, plan it out first. Brainstorm on how it’s supposed to work because the way you are showing us now does not demonstrate that you have thought about how your files are going to work. It seems you are just throwing whatever you find on the internet in your files. Please stop doing this because I already told you twice from your other thread not to do this. Plan how your files are supposed to work before you do anything like this or you’ll always get stuck.