Hi I really hope someone can help, I am desparately trying to understand sessions variables and it seems very easy and logical except i have been stuck on this for a day now...
Problem is i am trying to stockpile unique data keys in the sessions array, very simply i might add... whats happening is instead of appending the new data to the end of the existing array, it seems it replaces the existing array completely and the old data is lost...
consider this example:
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
$word=$_POST['word'];
array_push($_SESSION, $word);
print_r ($_SESSION);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>I'm Gonna Lose It</title>
</head>
<body>
<br />
<br />
<br />
<FORM METHOD="POST" ACTION="thisone.php">
Word: <input type="text" name="word">
<input type="SUBMIT" value="Submit">
</FORM>
</body>
</html>
It doesnt make any sense to me that it is replacing the array instead of adding to it... i have tried a bunch of ways that seem totally going overboard such as copying the array adding to it etc... same result... am i missing something very obvious?
phpbuilder has been an invaluable resource although its the first time i have posted just want to say thanks & take care
jonathan