我在 URL 中保存的页面上有一个表单page?slot=1
,我希望表单与该slot=1
值相对应,但它似乎没有转移到action="process.php"
我设置的那个。
您是否知道如何捕获选择了哪个插槽,然后将其与表单提交一起传输?
(selected_battle.php 需要 slot=1 并使其 $selected_battle = 1;然后 insert_battle_data.php 说如果 selected_battle=1,则使用那里的表格。但它永远不会得到 $selected_battle=2,只有 1。选择的战斗 php 也在下面。) FORM CODE:
<?php
require("selected_battle.php");
?>
<div style="float:left; margin-left:-40px; margin-top:-153px;">
<img src="../images/upload/btn_choosefile.png" border=0 style="margin-right:0px; float:right; margin-top:20px;"/>
</div>
</div>
<div style="float:left; margin-left:-468px; margin-top:40px;">
<form action="/controlpanel/insert_upload_battle_data.php" method="post" enctype="multipart/form-data">
<?php if (isset($_GET['slot'])) { ?>
<input type="hidden" name="slot" value="<?php echo htmlspecialchars($_GET['slot']); } ?>">
<input type="file" name="file" id="file" style="color:#FFFFFF; background-color: transparent; border-width: 0; border-color:transparent; border-style:hidden; width:240px; height:11px; padding-left:5px; margin-left: 428px; margin-top:-174px; float:left; font:'Lucida Console', Monaco, monospace; font-size:9px; padding-bottom:5px;" />
<input type="submit" name="submit" value="" class="ready_button" border="0" style="margin-left:683px; margin-top:-175px; float:left;" />
</div>
精选战斗 PHP
<?php
$selected_battle = 1;
if (!empty($_GET['slot'])) {
$slot = implode(',', $_GET);
} else {
$slot = 1;
}
echo $slot;
if ($slot == 1) {
$selected_battle=1;
}
else if ($slot == 2) {
$selected_battle=2;
}
else if ($slot == 3) {
$selected_battle=3;
}
else if ($slot == 4) {
$selected_battle=4;
}
else if ($slot == 5) {
$selected_battle=5;
}
else if ($slot == 6) {
$selected_battle=6;
}
else if ($slot == 'q') {
$selected_battle=7;
}
?>