我在$ _FILES的处理页面上遇到索引未找到错误.据我所知,我的代码在技术上是正确的(至少其他两个看过它的人也找不到任何错误).
首先,调用的函数显示带有文件上载的表单:
function portfolioEditor($p) {
echo "<form method=\"post\" action=\"" . siteurl . "/manage/update.php\">";
echo '<input type="text" name="name" id="name" class="grid4 first" value="' . $p['name'] . '" />';
echo '<input type="text" name="posttype" id="posttype" class="grid4" value="' . $p['posttype'] . '" />';
echo "\n<br />\n";
echo '<textarea name="content" id="content" class="grid8 first">' . $p['content'] . '</textarea>';
echo "\n<br />\n";
echo '<input type="hidden" name="MAX_FILE_SIZE" value="30000" />';
echo '<input name="file" value="' . $p['image'] . '" id="file" type="file" />';
echo '<input type="submit" value="Submit" name="submit" id="submit" />';
echo …Run Code Online (Sandbox Code Playgroud)