Der Thread im Forum konnte mir leider nicht helfen. Ich hoffe ihr könnte mir helfen.
Meine Selectboxen können sich die einträge nicht merken wenn man sie wieder editieren will sind die werte nicht wieder da. Und ich weiß nicht wieso.
Speichert man sie ab sind sie erst da. Will man dann was editieren fehlt alles und alles is wieder beim alten.
MFG André Gerdes
Eingabe Code:
Code: Alles auswählen
<?php
$rexname = split("~~", "REX_VALUE[1]");
?>
Waschmaschiene:
<select name="rexname[1]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[1]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Backofen:
<select name="rexname[2]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[2]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<br><option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Dusche:
<select name="rexname[3]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[3]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Kinderhochstuhl:
<select name="rexname[4]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[4]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Terasse:
<select name="rexname[5]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[5]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Gartenbenutzung:
<select name="rexname[6]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[6]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Geschirrspüler:
<select name="rexname[7]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[7]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Mikrowelle:
<select name="rexname[8]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[8]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Wannenbad:
<select name="rexname[9]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[9]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Kinderbett:
<select name="rexname[10]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[10]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Balkon:
<select name="rexname[11]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[11]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Herd 4-Plat:
<select name="rexname[12]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[12]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Kühlschrank:
<select name="rexname[13]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[13]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Radio:
<select name="rexname[14]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[14]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Internetanschluss:
<select name="rexname[15]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[15]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Grill:
<select name="rexname[16]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[16]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Schaukel:
<select name="rexname[17]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[17]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Gefrierfach:
<select name="rexname[18]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[18]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
CD/DVD:
<select name="rexname[19]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[19]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
SAT/Kabel-TV:
<select name="rexname[20]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[20]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Parkplatz:
<select name="rexname[21]">
<?php
$options = array('Nein', 'Ja');
$current = "rexname[21]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Fake Eintrag keine Änderung nötig!!!:
<select name="rexname[22]">
<?php
$options = array('Ja');
$current = "rexname[22]";
foreach ( $options as $option)
{
$selected = $option == $current ? ' selected="selected"' : '';
echo '<option'. $selected .'>'. $option .'</option>';
}
?>
</select><br>
Ausgabe Code:
Code: Alles auswählen
<style type="text/css">
#ja {
text-decoration: none;
background: transparent url('/files/ja.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top:5px;
float:left;
clear:both;
}
#ja2 {
text-decoration: none;
background: transparent url('/files/ja.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top: 5px;
float:left;
clear:both;
}
#ja3 {
text-decoration: none;
background: transparent url('/files/ja.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top:5px;
float:left;
clear:both;
}
#ja4 {
text-decoration: none;
background: transparent url('/files/ja.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top:5px;
float:left;
clear:both;
}
#nein {
text-decoration: none;
background: transparent url('/files/nein.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top:5px;
float:left;
clear:both;
}
#nein2 {
text-decoration: none;
background: transparent url('/files/nein.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top:5px;
float:left;
clear:both;
}
#nein3 {
text-decoration: none;
background: transparent url('/files/nein.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top:5px;
float:left;
clear:both;
}
#nein4 {
text-decoration: none;
background: transparent url('/files/nein.jpg') left center no-repeat scroll;
padding-left: 20px;
padding-top:5px;
float:left;
clear:both;
}
#check1
{
float:left;
padding-left:10px;
padding-bottom:10px;
}
#check2
{
float:left;
padding-left:62px;
}
#check3
{
float:left;
padding-left:62px;
}
#check4
{
float:left;
padding-left:62px;
color:
}
</style>
<body>
<?php
$rexname = split("~~", "REX_VALUE[1]");
$ausstattung = array("Waschmaschine","Backofen","Dusche","Kinderhochstuhl","Terasse","Gartenbenutzung","Geschirrspüler","Mikrowelle","Wannenbad","Kinderbett","Balkon","Herd 4-Plat.","Kühlschrank","Radio","Internetanschluß","Grill","Schaukel","Gefrierfach","CD/DVD","SAT/Kabel-TV","Parkplatz","Fake");
$i = 0;
echo'<fieldset style="border : 1px solid #3366CC;"><legend><strong><h3>Ausstatung</h3></strong></legend>';
echo '<div id="check1">';
foreach ($rexname as $rexnewname)
{
$rex = $i;
if($rexnewname == "Ja")
{
if($i <= 5)
{
echo '<div id="ja">'.current($ausstattung).'</div>';
next($ausstattung);
$i++;
}
}
else
{
if($i <= 5)
{
echo '<div id="nein">'.current($ausstattung).'</div>';
next($ausstattung);
$i++;
}
}
}
echo '</div>';
$i = 0;
echo '<div id="check2">';
foreach ($rexname as $rexnewname)
{
$rex = $i;
if($rexnewname == "Ja")
{
if($i >5 && $i <= 10)
{
echo '<div id="ja2">'.current($ausstattung).'</div>';
next($ausstattung);
}
$i++;
}
else
{
if($i >5 && $i <= 10)
{
echo '<div id="nein2">'.current($ausstattung).'</div>';
next($ausstattung);
}
$i++;
}
}
echo '</div>';
$i = 0;
echo '<div id="check3">';
foreach ($rexname as $rexnewname)
{
$rex = $i;
if($rexnewname == "Ja")
{
if($i > 10 && $i <= 15)
{
echo '<div id="ja3">'.current($ausstattung).'</div>';
next($ausstattung);
}
$i++;
}
else
{
if($i > 10 && $i <= 15)
{
echo '<div id="nein3">'.current($ausstattung).'</div>';
next($ausstattung);
}
$i++;
}
}
echo '</div>';
$i = 0;
echo '<div id="check4">';
foreach ($rexname as $rexnewname)
{
$rex = $i;
if($rexnewname == "Ja")
{
if($i > 15 && $i <= 20)
{
echo '<div id="ja4">'.current($ausstattung).'</div>';
next($ausstattung);
}
$i++;
}
else
{
if($i > 15 && $i <= 20)
{
echo '<div id="nein4">'.current($ausstattung).'</div>';
next($ausstattung);
}
$i++;
}
}
echo '</div>';
echo '</fieldset>';
?>