I have a form on a page which holds in the URL page?slot=1
and I want the form to correspond to the slot=1
value, but it doesn't seem to transfer over to the action="process.php"
that I have set up.
Do you have any idea on how to capture which slot is selected, and then transfer that with the form submit?
(selected_battle.php takes slot=1 and makes it $selected_battle = 1; then the insert_battle_data.php says if selected_battle=1, use the form there to such and such. but it never gets the $selected_battle=2, only 1. the selected battle php is below as well. ) 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>
SELECTED BATTLE 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;
}
?>