Salve,

potreste dare un'occhiata ai seguenti file??? Non capisco cosa non funziona... è un banalissimo esempio di utilizzo di sessioni...
Nel file php.ini ho settatto la variabile session.save_path

Tks

prefs.html
Codice PHP:
<html>
<
head><title>Set Your Preferences</title></head>
<
body>
<
form action="prefs.php" method="POST">

Background:
<
select name="background">
<
option value="black">Black</option>>
<
option value="white">White</option>
<
option value="red">Red</option>
<
option value="blue">Blue</option>
</
select>


Foreground:
<
select name="foreground">
<
option value="black">Black</option>>
<
option value="white">White</option>
<
option value="red">Red</option>
<
option value="blue">Blue</option>
</
select>


<
input type="submit" value="Change Preferences">
</
form>
</
body>
</
html
prefs.php
Codice PHP:
<?php
$colors 
= array('black' => '#000000',
                
'white' => '#ffffff',
                
'red'   => '#ff0000',
                
'blue'  => '#0000ff');

session_start();
session_register('bg');
session_register('fg');             

$bg_name $_POST['background'];
$fg_name $_POST['foreground'];

$bg $colors[$bg_name];
$fg $colors[$fg_name];
?>
<html>
<head><title>Preferences Set</title></head>
<body>
Thank you. Your preferences have been changed to:

Background: <?= $bg_name ?>

Foreground: <?= $fg_name ?>

Click [url="prefs-demo.php"]here[/url] to see the preferences in action.
</body>
</html>
prefs_demo.php
Codice PHP:
<?php session_start() ?>
<html>
<head><title>Front Door</title></head>
<body bgcolor="<?= $bg ?>" text="<?= $fg ?>">
<h1>Welcome to the Store</h1>

Would you like to [url="prefs1.html"]change your preferences?[/url]
</body>
</html>