Hi
Das geht noch n bisschen einfacher. Außerdem hab ich das xml-konforme <?php-Starttag genommen. Jez is auch der aktuelle Style selected:
<?php
if(isset($_POST['auswahl']))
{
setcookie("stylekeks", $_POST['auswahl'], time()+3600, "/");
$style = $_POST['auswahl'];
}
elseif(isset($_COOKIE['stylekeks']))
{
$style = $_COOKIE['stylekeks'];
}
else
{
$style = '1';
}
?>
<html>
<head>
<title>Styleswitcher</title>
<link rel="stylesheet" type="text/css" href="style<?php echo $style ?>.css">
</head>
<body>
<img src="kopf<?php echo $style ?>.jpg" alt="header">
<form method="post" action="index.php" name="formularstyle">
<p><select name="auswahl" size="1">
<?php
for($i=1;$i<=3;$i++):
if($i==$style)
echo "<option value='$i' selected>Style $i </option>';
else
echo "<option value='$i'>Style $i </option>';
endfor;
?>
</select></p>
<p><input type="submit" name="stylewahl" value="Style wählen"></p>
</form>
</body>
</html>
mfg
Genie