-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfarb.php
More file actions
32 lines (30 loc) · 1.02 KB
/
farb.php
File metadata and controls
32 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
if(!$_POST){
$_POST['Farbauswahlmerker']=2;
}
#print_r($_POST);
$Farben=array('red','green','white','black','blue');
$FarbenDE=array('Rot','Grün','Weiss','Schwarz','Blau');
echo '<form method="post">';
/*
echo '<div style="background-color:'.$Farben[key($_POST['Farbauswahl'])].';height:500px;width:600px;border:2px solid black">';
echo '</div>';
*/
/*
echo '<div style="height:500px;width:600px;border:2px solid black">';
echo
echo '</div>';
*/
echo '<div style="width:600px;border:1px solid black">';
for ($i=0; $i<count($Farben); $i=$i+1){
echo '<input type="submit" name="Farbauswahl['.$i.']" value="" style="width:40px; background-color:'.$Farben[$i].'; border:1px solid black" />';
}
echo '</div>';
echo '<input type="hidden" name="Farbauswahlmerker" value="'.$_POST['Farbauswahlmerker'].'">';
echo '</form>';
if (isset($_POST['Farbauswahl'])){
echo 'Sie haben '.$FarbenDE[key($_POST['Farbauswahl'])].' gewählt.';
$_POST['Farbauswahlmerker']=$Farben[key($_POST['Farbauswahl'])];
}
echo $_POST['Farbauswahlmerker'];
?>