Variabler bliver ikke sendt i post
Jeg har et script, hvor jeg sender nogle oplysninger igennem flere formularer.Når jeg kører scriptet fra Wamp virker det upåklageligt, men når jeg uploader det til serveren hos Danhost, bliver ingen data sendt igennem scriptet. Den kører rigtigt rundt mellem formularerne, men variablerne forbliver tomme.
Jeg benytter samme MySQL-database begge steder.
Jeg tillader mig at smide hele scriptet... Da jeg ingen anelse har om, hvor i scriptet der evt. måtte være fejl.
Håber nogen kan hjælpe.
------------------------------------------------------------
<?
include "connect.php";
if (isset($_GET['step'])) {
$step=$_GET['step'];
}
if ($step=='1') {
// step 1 update
if(isset($_POST['update_step1'])) {
IF ($_SERVER["REQUEST_METHOD"]=="POST" ) {
$recveid = mysql_query("SELECT kampid FROM kampstat ORDER BY kampid DESC LIMIT 0,1") or die(mysql_error());
while(list($subid) = mysql_fetch_row($recveid)){
$newid = $subid+1;
}
$date = $dag;
$date .= $mdr;
$newmatch = mysql_query ("INSERT INTO `kampstat` (`kampid`,`hjemmehold`,`udehold`,`hjemmaal`,`udmaal`,`dato`,`praefiks`,`status`) VALUES ('".$newid."','".$hjemmehold."','".$udehold."','".$hjemmaal."','".$udmaal."','".$date."','".$praefiks."','".$status."')");
ob_start();
header("Location: $PHP_SELF?step=2&mloop=".$maalffa06."&gloop=".$gkffa06."&rloop=".$rkffa06."&kampid=".$newid."&cs=".$cs."");
ob_flush();
/* echo "<script language='javascript'>\n";
echo "window.location='$PHP_SELF?step=2&mloop=".$maalffa06."&gloop=".$gkffa06."&rloop=".$rkffa06."&kampid=".$newid."&cs=".$cs."';\n";
echo "</script>\n"; */
exit();
}
}
// step 1
echo "<table cellspacing='2' cellpadding='2' border='0'><tr>\n";
echo "<td class='tbl'><b>Tilføj kamp</b></td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'><form name='step1' method='post'>Dato:</td>\n";
echo "<td class='tbl'><select name='dag' class='textbox'>\n";
echo "<option value=''></option>\n";
echo "<option value='1.'>1</option>\n";
echo "<option value='2.'>2</option>\n";
echo "<option value='3.'>3</option>\n";
echo "<option value='4.'>4</option>\n";
echo "<option value='5.'>5</option>\n";
echo "<option value='6.'>6</option>\n";
echo "<option value='7.'>7</option>\n";
echo "<option value='8.'>8</option>\n";
echo "<option value='9.'>9</option>\n";
echo "<option value='10.'>10</option>\n";
echo "<option value='11.'>11</option>\n";
echo "<option value='12.'>12</option>\n";
echo "<option value='13.'>13</option>\n";
echo "<option value='14.'>14</option>\n";
echo "<option value='15.'>15</option>\n";
echo "<option value='16.'>16</option>\n";
echo "<option value='17.'>17</option>\n";
echo "<option value='18.'>18</option>\n";
echo "<option value='19.'>19</option>\n";
echo "<option value='20.'>20</option>\n";
echo "<option value='21.'>21</option>\n";
echo "<option value='22.'>22</option>\n";
echo "<option value='23.'>23</option>\n";
echo "<option value='24.'>24</option>\n";
echo "<option value='25.'>25</option>\n";
echo "<option value='26.'>26</option>\n";
echo "<option value='27.'>27</option>\n";
echo "<option value='28.'>28</option>\n";
echo "<option value='29.'>29</option>\n";
echo "<option value='30.'>30</option>\n";
echo "<option value='31.'>31</option>\n";
echo "</select><select name='mdr' class='textbox'>\n";
echo "<option value=''></option>\n";
echo "<option value='januar'>januar</option>\n";
echo "<option value='februar'>februar</option>\n";
echo "<option value='marts'>marts</option>\n";
echo "<option value='april'>april</option>\n";
echo "<option value='maj'>maj</option>\n";
echo "<option value='juni'>juni</option>\n";
echo "<option value='juli'>juli</option>\n";
echo "<option value='august'>august</option>\n";
echo "<option value='september'>september</option>\n";
echo "<option value='oktober'>oktober</option>\n";
echo "<option value='november'>november</option>\n";
echo "<option value='december'>december</option>\n";
echo "</select></td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'>Hjemmehold:</td>\n";
echo "<td class='tbl'><select name='hjemmehold' class='textbox'>\n";
echo "<option value=''></option>\n";
echo "<option value='FFa06'>FFa06</option>\n";
echo "<option value='BK Sidste Chance'>BK Sidste Chance</option>\n";
echo "<option value='Cph. MetroStars'>Cph. MetroStars</option>\n";
echo "<option value='Den Jyske Fraktion'>Den Jyske Fraktion</option>\n";
echo "<option value='FC Krølben'>FC Krølben</option>\n";
echo "<option value='FC Tre Falke'>FC Tre Falke</option>\n";
echo "<option value='Fedets Drenge'>Fedets Drenge</option>\n";
echo "<option value='FIH'>FIH</option>\n";
echo "<option value='G & T'>G & T</option>\n";
echo "<option value='Gribben Fodbold'>Gribben Fodbold</option>\n";
echo "<option value='Midtbyen Sport-Verein'>Midtbyen Sport-Verein</option>\n";
echo "<option value='Pantani Pirates'>Pantani Pirates</option>\n";
echo "</select></td>\n";
echo "<td class='tbl'>Mål:</td>\n";
echo "<td class='tbl'><input type='text' name='hjemmaal' value='' maxlength='3' class='textbox' style='width:20px;'></td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'>Udehold:</td>\n";
echo "<td class='tbl'><select name='udehold' class='textbox'>\n";
echo "<option value=''></option>\n";
echo "<option value='FFa06'>FFa06</option>\n";
echo "<option value='BK Sidste Chance'>BK Sidste Chance</option>\n";
echo "<option value='Cph. MetroStars'>Cph. MetroStars</option>\n";
echo "<option value='Den Jyske Fraktion'>Den Jyske Fraktion</option>\n";
echo "<option value='FC Krølben'>FC Krølben</option>\n";
echo "<option value='FC Tre Falke'>FC Tre Falke</option>\n";
echo "<option value='Fedets Drenge'>Fedets Drenge</option>\n";
echo "<option value='FIH'>FIH</option>\n";
echo "<option value='G & T'>G & T</option>\n";
echo "<option value='Gribben Fodbold'>Gribben Fodbold</option>\n";
echo "<option value='Midtbyen Sport-Verein'>Midtbyen Sport-Verein</option>\n";
echo "<option value='Pantani Pirates'>Pantani Pirates</option>\n";
echo "</select></td>\n";
echo "<td class='tbl'>Mål:</td>\n";
echo "<td class='tbl'><input type='text' name='udmaal' value='' maxlength='3' class='textbox' style='width:20px;'></td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'>Udfald:</td>\n";
echo "<td class='tbl'>\n";
echo "<input type='radio' name='praefiks' class='textbox' value='S' checked>Sejr\n";
echo "<input type='radio' name='praefiks' class='textbox' value='U'>Uafgjort\n";
echo "<input type='radio' name='praefiks' class='textbox' value='N'>Nederlag\n";
echo "</td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'>Taberdømt:</td>\n";
echo "<td class='tbl'>\n";
echo "<input type='checkbox' name='status' class='textbox' value='HT'> Hjemmehold / \n";
echo "<input type='checkbox' name='status' class='textbox' value='UT'> Udehold\n";
echo "</td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'>Antal mål til FFa06:</td>\n";
echo "<td class='tbl'><input type='text' name='maalffa06' value='0' maxlength='3' class='textbox' style='width:20px;'></td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'>Antal Gule kort til FFa06:</td>\n";
echo "<td class='tbl'><input type='text' name='gkffa06' value='0' maxlength='3' class='textbox' style='width:20px;'></td>\n";
echo "</tr><tr>\n";
echo "<td class='tbl'>Antal Røde kort til FFa06:</td>\n";
echo "<td class='tbl'><input type='text' name='rkffa06' value='0' maxlength='3' class='textbox' style='width:20px;'></td>\n";
echo "</tr><tr><td class='tbl'>Blev målet holdt rent:</td><td class='tbl'>\n";
echo "<input type='radio' name='cs' class='textbox' value='Y' checked>Ja\n";
echo "<input type='radio' name='cs' class='textbox' value='N'>Nej\n";
echo "</td>\n";
echo "</tr><tr><td colspan='4' align='center'><input type='submit' name='update_step1' value='Gå til næste skridt' class='button'></form></td></tr></table>\n";
}
if ($step=='2') {
$mloop=$_GET['mloop'];
$gloop=$_GET['gloop'];
$rloop=$_GET['rloop'];
$larsid=$_GET['kampid'];
$cleansheet=$_GET['cs'];
//step 2 update
if(isset($_POST['update_step2'])) {
IF ($_SERVER["REQUEST_METHOD"]=="POST" ) {
//kampstat spillere til kamp update
$tilkamp = '';
for ($ti=1; $ti<=17; $ti++) {
$teter = 'spillerkamp';
$teter .= $ti;
$tilkamp .= ' ';
$tilkamp .= $$teter;
$tilkamp .= ' ';
}
mysql_query("UPDATE kampstat SET spiller='".$tilkamp."' WHERE kampid='".$larsid."'");
//kampstat mål i kamp update
$maalikamp = '';
for ($pi=1; $pi<=$mloop; $pi++) {
$peter = 'maal';
$peter .= $pi;
$maalikamp .= ' ';
$maalikamp .= $$peter;
$maalikamp .= ' ';
}
mysql_query("UPDATE kampstat SET score='".$maalikamp."' WHERE kampid='".$larsid."'");
//kampstat gk i kamp update
$gkikamp = '';
for ($gi=1; $gi<=$gloop; $gi++) {
$geter = 'gk';
$geter .= $gi;
$gkikamp .= ' ';
$gkikamp .= $$geter;
$gkikamp .= ' ';
}
mysql_query("UPDATE kampstat SET gulekort='".$gkikamp."' WHERE kampid='".$larsid."'");
//kampstat rk i kamp update
$rkikamp = '';
for ($ri=1; $ri<=$rloop; $ri++) {
$reter = 'rk';
$reter .= $ri;
$rkikamp .= ' ';
$rkikamp .= $$reter;
$rkikamp .= ' ';
}
mysql_query("UPDATE kampstat SET roedekort='".$rkikamp."' WHERE kampid='".$larsid."'");
//kampstat assist i kamp update
$assistikamp = '';
for ($ai=1; $ai<=$mloop; $ai++) {
$aeter = 'assist';
$aeter .= $ai;
$assistikamp .= ' ';
$assistikamp .= $$aeter;
$assistikamp .= ' ';
}
mysql_query("UPDATE kampstat SET oplaeg='".$assistikamp."' WHERE kampid='".$larsid."'");
//spillerstat målupdate
for ($pi=1; $pi<=$mloop; $pi++) {
$peter = 'maal';
$peter .= $pi;
$scoresultmaal = mysql_query("SELECT maal FROM spillerstat WHERE navn='".$$peter."' ") or die(mysql_error());
while(list($gmaal) = mysql_fetch_row($scoresultmaal)){
$nymaal = $gmaal+1;
}
mysql_query("UPDATE spillerstat SET maal='".$nymaal."' WHERE navn='".$$peter."'");
}
//spillerstat gkupdate
for ($gi=1; $gi<=$gloop; $gi++) {
$geter = 'gk';
$geter .= $gi;
$scoresultgk = mysql_query("SELECT gk FROM spillerstat WHERE navn='".$$geter."' ") or die(mysql_error());
while(list($ggk) = mysql_fetch_row($scoresultgk)){
$nygk = $ggk+1;
}
mysql_query("UPDATE spillerstat SET gk='".$nygk."' WHERE navn='".$$geter."'");
}
//spillerstat assupdate
for ($ai=1; $ai<=$mloop; $ai++) {
$aeter = 'assist';
$aeter .= $ai;
$scoresultass = mysql_query("SELECT assist FROM spillerstat WHERE navn='".$$aeter."' ") or die(mysql_error());
while(list($gassist) = mysql_fetch_row($scoresultass)){
$nyassist = $gassist+1;
}
mysql_query("UPDATE spillerstat SET assist='".$nyassist."' WHERE navn='".$$aeter."'");
}
//spillerstat rkupdate
for ($ri=1; $ri<=$rloop; $ri++) {
$reter = 'rk';
$reter .= $ri;
$scoresultrk = mysql_query("SELECT rk FROM spillerstat WHERE navn='".$$reter."' ") or die(mysql_error());
while(list($grk) = mysql_fetch_row($scoresultrk)){
$nyrk = $grk+1;
}
mysql_query("UPDATE spillerstat SET rk='".$nyrk."' WHERE navn='".$$reter."'");
}
//spillerstat kampupdate
for ($ki=1; $ki<=17; $ki++) {
$keter = 'spillerkamp';
$keter .= $ki;
$scoresultkamp = mysql_query("SELECT kampe FROM spillerstat WHERE navn='".$$keter."' ") or die(mysql_error());
while(list($gkam) = mysql_fetch_row($scoresultkamp)){
$nykam = $gkam+1;
}
mysql_query("UPDATE spillerstat SET kampe='".$nykam."' WHERE navn='".$$keter."'");
}
//spillerstat csupdate
$csresult = mysql_query("SELECT cs FROM spillerstat WHERE id='".$celas."' ") or die(mysql_error());
while(list($gcs) = mysql_fetch_row($csresult)){
$nycs = $gcs+1;
}
mysql_query("UPDATE spillerstat SET cs='".$nycs."' WHERE id='".$celas."'");
//redirect
ob_start();
header("Location: $PHP_SELF?step=3&mloop=".$maalffa06."&gloop=".$gkffa06."&rloop=".$rkffa06."&kampid=".$newid."&cs=".$cs."");
ob_flush();
/* echo "<script language='javascript'>\n";
echo "window.location='$PHP_SELF?step=3&mloop=".$maalffa06."&gloop=".$gkffa06."&rloop=".$rkffa06."&kampid=".$newid."&cs=".$cs."';\n";
echo "</script>\n";*/
exit();
}
}
//step 2
echo "<table cellspacing='2' cellpadding='2' border='0'><form name='step2' method='post'><tr>\n";
echo "<td class='tbl'><b>Vælg aktører</b></td></tr>\n";
echo "<tr><td class='tbl' valign='top'><u>Spillere til kamp</u><br>Vælg spillere:</td>\n";
echo "<td class='tbl' colspan='5'><table><tr>\n";
$spil = mysql_query("select * from spillerstat WHERE id!='0' ORDER BY navn ASC");
$j = 1;
while(list($id,$name) = mysql_fetch_row($spil)){
if($j==3){
echo "<td class='tbl'><input type='checkbox' name='spillerkamp".$id."' class='textbox' value='".$name."'> ".$name."</td></tr><tr>\n";
$j = 1;
} else {
echo "<td class='tbl'><input type='checkbox' name='spillerkamp".$id."' class='textbox' value='".$name."'> ".$name."</td>\n";
$j++;
}
}
echo "</tr></table>\n";
echo "</td></tr>\n";
//målloop
echo "<tr><td class='tbl'><u>Mål</u></td></tr>\n";
for ($i=1; $i<=$mloop; $i++) {
echo "<tr>\n";
echo "<td class='tbl'>Mål ".$i." blev scoret af:</td>\n";
echo "<td class='tbl'><select name='maal".$i."' class='textbox'>\n";
echo "<option value=''></option>\n";
$mal = mysql_query("select navn from spillerstat WHERE id!='0' ORDER BY navn ASC");
while(list($name) = mysql_fetch_row($mal)){
echo "<option value='".$name."'>".$name."</option>\n";
}
echo "</select></td><td></td><td></td>\n";
echo "<td class='tbl'>Assist ".$i." blev lavet af:</td>\n";
echo "<td class='tbl'><select name='assist".$i."' class='textbox'>\n";
echo "<option value=''></option>\n";
$assist = mysql_query("select navn from spillerstat WHERE id!='0' ORDER BY navn ASC");
while(list($name) = mysql_fetch_row($assist)){
echo "<option value='".$name."'>".$name."</option>\n";
}
echo "</select></td></tr>\n";
}
// gultloop
echo "<tr><td class='tbl'><u>Gule kort</u></td></tr>\n";
for ($k=1; $k<=$gloop; $k++) {
echo "<tr>\n";
echo "<td class='tbl'>Det ".$k.". gule kort blev givet til:</td>\n";
echo "<td class='tbl'><select name='gk".$k."' class='textbox'>\n";
echo "<option value=''></option>\n";
$gultk = mysql_query("select navn from spillerstat WHERE id!='0' ORDER BY navn ASC");
while(list($name) = mysql_fetch_row($gultk)){
echo "<option value='".$name."'>".$name."</option>\n";
}
echo "</select></td></tr>\n";
}
// rødtloop
echo "<tr><td class='tbl'><u>Røde kort</u></td></tr>\n";
for ($r=1; $r<=$rloop; $r++) {
echo "<tr>\n";
echo "<td class='tbl'>Det ".$r.". røde kort blev givet til:</td>\n";
echo "<td class='tbl'><select name='rk".$r."' class='textbox'>\n";
echo "<option value=''></option>\n";
$rodk = mysql_query("select navn from spillerstat WHERE id!='0' ORDER BY navn ASC");
while(list($name) = mysql_fetch_row($rodk)){
echo "<option value='".$name."'>".$name."</option>\n";
}
echo "</select></td></tr>\n";
}
// Cleansheet
echo "<tr><td class='tbl'><u>Clean Sheet</u></td></tr>\n";
if ($cs=='Y'){
echo "<tr>\n";
echo "<td class='tbl'>Målet blev holdt rent af:</td>\n";
echo "<td class='tbl'><select name='celas' class='textbox'>\n";
echo "<option value=''></option>\n";
$cela = mysql_query("select id,navn from spillerstat WHERE id!='0' ORDER BY navn ASC");
while(list($id,$name) = mysql_fetch_row($cela)){
echo "<option value='".$id."'>".$name."</option>\n";
}
echo "</select></td>\n";
}
echo "<tr><td class='tbl' colspan='6' align='center'><input type='submit' name='update_step2' value='Tilføj statistik' class='button'></form></td></tr></table>\n";
}
if ($step=='3') {
echo "Kampen med dens statistik er nu tilført systemet, og du kan lukke vinduet.\n";
echo "<br><i>Hvis du lavede fejl undervejs, eller du fik en fejl meddelelse, bedes du kontakte webmaster</i>\n";
}
?>
------------------------------------------------------------