| | |
session variable problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Feb 2008
Posts: 20
Reputation:
Solved Threads: 0
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
this is wordfindkey2.php
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
PHP Syntax (Toggle Plain Text)
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 Syntax (Toggle Plain Text)
<?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>
•
•
Join Date: Jul 2008
Posts: 44
Reputation:
Solved Threads: 1
0
#2 Nov 7th, 2009
In wordfind.php, when you set the session variables, the session variables should be capitalized like this.
php Syntax (Toggle Plain Text)
$_SESSION["key"] = $keyPuzzle; $_SESSION["puzzleName"] = $puzzleName;
![]() |
Similar Threads
- ASP.NET - session objects Problem (ASP.NET)
- Session variable keeping login information (ASP.NET)
- Session Variable clashing (ASP.NET)
- Losing session variable problem...help! (ASP)
- session variable undefined in MX 6.1, works in CF 5 (ColdFusion)
- Session variable (ASP.NET)
- session variable:again (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: PHP and webcam
- Next Thread: need help - survey voting
Views: 299 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database dataentry date directory display download dynamic echo email error file files firstoptioninphpdroplist folder form forms freelancing function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table tutorial tutorials update updates upload url validation validator variable video web white xml youtube






