我有一个动态表单,用于上传图片或YouTube视频以进行幻灯片放映。但是当我点击发送时,服务器不会捕获数据。我可以在浏览器网络面板中看到我向使用参数填充的服务器发送了一个post请求。但是当服务器获取请求时,$ _POST数组为空。
之前的代码工作但是我已经有半年的时间没有工作了,但几周之前就已经开始工作了。我一直在做的事情是在另一个网站上工作并在我的网站上更改一些PHP设置,但我找不到任何会阻止POST请求的设置。
我删除了所有输入字段,因为SO不会让我发布这么多代码。
<form id="slideForm" action="php/upload.php" method="post" enctype="multipart/form-data">
<fieldset id="media">
<legend>Load upp new slide </legend>
<label for="mediaType">Media type</label>
<select name="mediaType" id="mediaType">
<option value="empty" selected="selected"></option>
<option value="image">Image (jpeg, jpg, png)</option>
<option value="youtube">Youtube</option>
</select>
<div id="local"> <!-- Only if image is selected -->
<label for="localImageLocal">Local file</label>
<input type="radio" name="localImage" id="localImageLocal" value="local" />
<label for="lovalImageUrl">Internet image</label>
<input type="radio" name="localImage" id="localImageUrl" value="url" />
</div>
<div id="image">
<div id="imageFileDiv">
<label for="imageFile">Upload image (jpeg, jpg, png)</label>
<input type="hidden" name="MAX_FILE_SIZE" value="4000000" />
<input type="file" name="imageFile" id="imageFile" accept=".jpeg,.jpg,.png" />
</div>
<div id="urlImageDiv">
<label for="urlImage">Url to image</label>
<input type="url" name="urlImage" id="urlImage">
<br />
<div id="imageName">
<label for="urlImageName">Name the image</label>
<input type="text" name="urlImageName" id="urlImageName" />
</div>
</div>
</div>
<div id="youtube">
<label for="youtubeUrl">Url to video </label>
<input type=url name="youtubeUrl" id="youtubeUrl" checked />
</div>
</fieldset>
<fieldset id="settingsField">
<div id="settings">
<div id="effects">
<h2>Effects</h2>
<label for="effectNone">None</label>
<input type="radio" name="effect[]" id="effectNone" value="none" checked />
<label for="effectBlink">Blink</label>
<input type="checkbox" name="effect[]" id="effectBlink" value="blink"/>
<label for="effectHorn">Horn</label>
<input type="checkbox" name="effect[]" id="effectHorn" value="horn"/>
</div>
<br />
<div id="videoSettings">
<!--<label for="playToEnd"> Play to end off video </label>
<input type="checkbox" name="playToEnd" id="playToEnd" value="playToEnd"> -->
<span> Video will allways run to the end </span>
</div>
<div id="duration">
<label for="duration" >Image duration: </label>
<span id="durationLabel">10</span>
<input type="range" name="duration" id="durationRange" min="1" value="10" max="180" step="1" />
</div>
<br />
<div id="priority">
<label for="priority">Priority</label>
<input type="number" name="priority" id="priority" min="0" value="0"/>
</div>
<br />
<div id="startSettings">
<label for="startNow"> Start now </label>
<input type="checkbox" name="startNow" id="startNow" value="true" checked/>
<div id="timeAndDate">
<label for="startDate">Start date</label>
<input type="text" name="startDate" id="startDate" value="2015-01-01" />
<label for="startTime">Start time</label>
<input type="text" name="startTime" id="startTime" value="00:00:00" />
<br />
<label for="endDate">End date</label>
<input type="text" name="endDate" id="endDate" value="2015-01-02" />
<label for="endTime">End time</label>
<input type="text" name="endText" id="endTime" value="24:00:00" />
</div>
</div><!-- END startSettings -->
</div><!-- END settings -->
<input type="submit" name="submit" id="submit" value="ADD"/>
</fieldset>
</form>
展示$ _POST和$ _REQUEST为空
require_once("config.php");
var_dump($_REQUEST);
if(!isset($_POST["submit"])){
exit("No data");
}