Im trying to use session variables to save the puzzle key, and than open a new file that prints it out, but it gives me
Notice: Undefined index: puzzleName in C:\Apache2.2\htdocs\users\jmdrenning0\wordfind\wordfindkey2.php on line 13
i have no idea what it means, any help please.
wordfind.php
function printPuzzle(){
//print puzzle
global $puzzle, $word, $keyPuzzle, $boardData;
//print puzzle itself
print <<<HERE
<h1>{$boardData["name"]}</h1>
$puzzle
<h3>Word List</h3>
<u1>
HERE;
//print word list
foreach ($word as $theWord){
$theWord = rtrim($theWord);
print "<li>$theWord</li>\n";
}
print "</ul>\n";
$puzzleName = $boardData["name"];
//print form for requesting answer key
//save answer key as session variable
$_Session["key"] = $keyPuzzle;
$_Session["puzzleName"] = $puzzleName;
print <<<HERE
<form action = "wordfindkey2.php"
method = "post"
id = "keyForm">
<div>
<input type = "submit"
value = "show answer key" />
</div>
</form>
HERE;
}
this is wordfindkey2.php
<?php session_start() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Word Find Answer Key</title>
<link rel="stylesheet" type="text/css" href="wordfind.css" />
</head>
<body>
<?php
// answer key for word find called from session variable
$puzzleName = $_SESSION["puzzleName"];
$key = $_SESSION["key"];
//$_Session["key"] = $keyPuzzle;
//$_Session["puzzleName"] = $puzzleName;
print <<<HERE
<h1>$puzzleName Answer key</h1>
$key
HERE;
?>
</body>
</html>