这是我的HTML表单:
<div class="container">
<div class="panel panel-default">
<div class="panel heading">
<h1 style="text-align: center;">Choose your difficulty level </h1>
</div>
<div class="panel-body">
<div class="form-group">
<fieldset>
<form action="backup.php" method="POST">
<h4>What is your difficulty level?</h4>
<select name="startdiff" class="form-control">
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
</select>
<br />
<input type="button" name="subdiff" class="btn-primary btn-lg btn-success" value="Let's go!">
</form>
</fieldset>
</div>
</div>
</div>
</div>
这就是&#34; backup.php&#34;看起来像:
<?php
include('connect.php');
include('my_class.php');
$admin = new User();
if (isset($_POST['subdiff']))
{
$difficulty = $_POST['startdiff'];
$admin->set_difficulty($difficulty);
header('Location: getstarted.php');
}
?>
请注意,我将其命名为backup.php
,因为我的POST方法都包含在一个巨大的切换方法中,但是这个特定的形式是唯一一个给我带来问题的形式,所以请不要告诉我传统的命名方法
可能是什么问题?