von Tommmy |
arg, ich könnt mich schlagen, alles klar, danke @ raiserle |
von raiserle |
jup chip.
stimmt schon, wie er es gepostet, verstehe ich auch nicht, warum da nix kommt.
aber laut der seite, die er angegeben hat, steht halt was anderes im quelltext. |
von chip |
raiserle schrieb am 01.11.2007 10:19
ps: size hat nix mit array zu tun
name="a1[]" wäre ein array und wenn du das vor hattest, dann solltest du das auch so machen. |
Gut, hast ja recht. In dem Quelltext den er gepostet hast, ist der Fehler aber nicht drin. Und solche Fehler sollten schon auffallen, denn jeder gute PHP-Programmierer hat auch error_reporting auf E_ALL stehen . |
von raiserle |
laut deinem Quelltext:
<select name="A1_select" size="1">
wie soll das denn dann auch gehen??
wenn du nur aX abfragst.
ps: size hat nix mit array zu tun
name="a1[]" wäre ein array und wenn du das vor hattest, dann solltest du das auch so machen. |
von chip |
Lass mal das size="1" bei den Select-Boxen weg. Vielleicht liegt es daran, denn so hat PHP evtl. das ganze in einem Array abgelegt (nicht getestet). |
von Tommmy |
Hallihallo!
Also, ich bin ein Neuling auf dem Gebiet php und dem Zeugs drumrum.
Ich habe folgendes zusammengebastelt:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="blubb" />
<title>position Armee</title>
<style type="text/css" media="all"><!--
#FormName { width: 576px; height: 223px; }
#container1 { width: 575px; height: 49px; }
.dsR2 /*agl rulekind: base;*/ { width: 576px; height: 181px; }
.dsR4 /*agl rulekind: base;*/ { background-color: #9dbbb3; text-align: center; }
.dsR18 /*agl rulekind: base;*/ { text-align: center; }
.dsR24 /*agl rulekind: base;*/ { position: fixed; top: 250px; left: 250px; }
--></style>
</head>
<body>
<div id="container1">
<div align="center">
<p>position 4 armees consisting of 1 xxx, 4 warriors, 4 bowmen, ...</p>
</div>
</div>
<form id="FormName" action="battle.php" method="post">
<table class="dsR2" border="1" cellspacing="2" cellpadding="0">
<tr>
<td class="dsR4"><select name="a1" size="1">
<option value="none">none</option>
<option value="warriors">warriors</option>
<option value="bowmen">bowmen</option>
</select></td>
<td class="dsR4"><select name="select_armee" size="1">
<option value="none">none</option>
<option value="warriors">warriors</option>
<option value="bowmen">bowmen</option>
</select></td>
...
<td class="dsR18">N/A</td>
</tr>
</table>
<input class="dsR24" type="submit" name="submitButtonName" />
</form>
<p></p>
</body>
</html>
so, und meine battle.php sieht folgendermaßen aus:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="blubb" />
<title>battle</title>
</head>
<body>
<?php
$i_armees = 0; $i_warriors = 0; $i_bowmen = 0; $i_count = 0;
$select_armee = $_POST['select_armee'];
//$n = count($select_armee);
$i = 0;
$value = 0;
echo "moin";
echo $_POST['a1'];
echo $_POST['submitButtonName'];
?>
<div class="dsR1" style=" position: relative; -adbe-g: p;"></div>
<p></p>
</body>
</html>
und mein Problem ist jetzt, dass das value des select-forms a1 nicht ausgegeben wird, der output von a1 ist folgendermaßen:
"moinSubmit"
ich kann mir einfach nciht mehr helfen ...
achso und falls ich nichts dran verändere könnt ihr den output auch nochmal hier nachvollziehen:
http://alliwantistest.al.funpic.de/position_armees.html
Ich danke euch schon im Voraus für eure Antworten! |
|