| | |
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
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary body broken cakephp checkbox class cms code cron curl database date date/time directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite msqli_multi_query multiple mycodeisbad mysql oop parse paypal pdf php problem query radio random recursion regex remote script search send seo server sessions sms soap source space sql static structure syntax system table tutorial update upload url validation validator variable video web webdesign wordpress xml youtube






