This is the deal... when I first get into the site (without a cookie) it says:
Notice: Undefined index: set1 in c:\inetpub\wwwroot\jesper2\index.php on line 17
its strange couse i belive i have set the value to:bilder/bakgrund/bodybg2.jpg
And an ohther thing when is trying this... I had to press the radio button twice to change the background... strange... Pls help me and sorry for the messy code but im in abit of hurry. Perhaps i should upload it some where but i dont know any free phpwebserver.
Thx knuff
<?php
// Sätt kaka
setcookie("test", "bilder/bakgrund/bodybg2.jpg", time()+36001000);
if(isset($REQUEST["set1"]))
{
setcookie("test", $REQUEST["set1"], time()+36001000);
}
?>
<html>
<head>
<title>Jesper Thor @ mpro02, Master of Media</title>
</head>
<body background="<?php echo($HTTP_COOKIE_VARS['test'])?>">
<?PHP echo($_REQUEST["set1"])?>
<table width="500" noresize="true" height="1000" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="100" valign="top">
<table width="100" bgcolor="#FFFFFF" border="0">
<tr>
<td align="left" colspan="2">bak</td>
</tr>
<tr>
<?PHP
if(!isset($_REQUEST["set1"]))
{
?>
<form name="f1" action="index.php" method="post">
<td><input type="radio" name="set1" value="bilder/bakgrund/bodybg2.jpg" onclick="document.f1.submit()"></td>
<td><input type="radio" name="set1" value="bilder/bakgrund/bodybg3.jpg" onclick="document.f1.submit()"></td>
</form>
</tr>
</table>
<?php
}
else
{
$set1 = $_REQUEST["set1"];
?>
<form name='f1' action='index.php' method='post'>
<td><input type='radio' name='set1' value='bilder/bakgrund/bodybg2.jpg' onclick='document.f1.submit()'></td>
<td><input type='radio' name='set1' value='bilder/bakgrund/bodybg3.jpg' onclick='document.f1.submit()'></td>
</form>
</tr>
</table>
<?PHP
}
?>
</td>
<td width="400" valign="top">
<table width="400" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="3">
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>bröd text
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td colspan="1">Respect.</td>
</tr>
</table>
</body>
</html>