note 102252 added to reserved.variables.files

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
In the past you could unconditionally call $_FILES['profile_pic'] without ever having to worry about PHP spitting an "Undefined index: profile_pic" error (so long as the page posting had a file input on it (e.g. <input type="file" name="profile_pic" />)). This was the case regardless of whether or not the end user actually uploaded a file. These days, with so many people browsing the web via iPads, you have to explicitly check to see if the input isset($_FILES['profile_pic']) before calling into it, else you'll get the aforementioned error message. This is because iOS devices running Safari disable file inputs thereby causing them to be treated as if they don't exist. Time to update your scripts!

-john
----
Server IP: 69.147.83.197
Probable Submitter: 75.72.250.179
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.files.php
Edit        -- https://master.php.net/note/edit/102252
Del: integrated  -- https://master.php.net/note/delete/102252/integrated
Del: useless     -- https://master.php.net/note/delete/102252/useless
Del: bad code    -- https://master.php.net/note/delete/102252/bad+code
Del: spam        -- https://master.php.net/note/delete/102252/spam
Del: non-english -- https://master.php.net/note/delete/102252/non-english
Del: in docs     -- https://master.php.net/note/delete/102252/in+docs
Del: other reasons-- https://master.php.net/note/delete/102252
Reject      -- https://master.php.net/note/reject/102252
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.