问题是我创建了以下表单:
<form action="" method="get">
<div class="select">
<input name="u" type="radio" value="meme" class="memeSelect" <?php echo $selectMeme ?>>
<label for="meme">Meme</label>
<input name="u" type="radio" value="plantilla" class="plantillaSelect" <?php echo $selectPlantilla ?>>
<label for="plantilla">Plantilla</label>
<input type="submit" class="invisible selectMemePlantilla">
</div>
</form>
<form enctype="multipart/form-data" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
<div class="meme <?php echo $invisibleMeme ?>">
<input type="hidden" name="MAX_FILE_SIZE" value="20000"/>
<input type="file" class="file" name="file" accept="image/png, image/jpeg, image/gif, image/pjpeg">
<h2>Elije las clases para el meme</h2>
<div class="clases">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
</div>
<span><?php echo $error ?></span>
<input type="submit" name="uploadBtn" value="Upload">
</div>
<div class="plantilla <?php echo $invisiblePlantilla ?>">
<input type="hidden" name="MAX_FILE_SIZE" value="20000"/>
<input type="file" class="file" name="file" accept="image/png, image/jpeg, image/gif, image/pjpeg">
<h2>Elije las clases para la plantilla</h2>
<div class="clases">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
</div>
<span><?php echo $error ?></span>
<input type="submit" name="uploadBtn" value="Upload">
</div>
</form>
如您所见,上传图片的页面,首先有一个获取表单转到上传模因或模板的页面,然后发布将图片上传到服务器的帖子。
第一种形式完美运行,但第二种形式不行,我总是跳过没有文件上传的错误 4。
我创建了另一个文件来查看服务器是否存在问题或其他问题,但一切正常。问题一定是在尝试使用 get 时,但我不知道如何修复它。
MYYA