> After collecting the input data from a FORM via an array (name=kgkeys)
> the next function starts:
> <?php
> session_start();
> $_SESSION['g_numprimarykeys'] = $_POST['numprimarykeys']; //This
always
> works ok first time through
> $_SESSION['g_kgkeys'] = $_POST['kgkeys']; //This always works ok first
> time through
> /* An alternative to the above:
> if ( $action == "edit" )

Where is $action coming from? Should it be $_POST['action'] ??

>       {
>       $_SESSION['g_numprimarykeys'] = $_POST['numprimarykeys']; //
This
> always fails - perhaps the block places it out of scope?
>       $_SESSION['g_kgkeys'] = $_POST['kgkeys']; // This always fails -
> perhaps the block places it out of scope?
>       }
> */
> switch ($action)
>       {
>       case "add":
>               include "./kgadd.php";
>       break;
>       case "edit":
>               include "./kgedit.php";
>       break;
> -------------------------------------------------------------------
> Next file:
> <?php
> session_start();
> 
> include("kgstyle.php");
> include("Database.php");
> 
> $temp = 'g_kgkeys';
> foreach ($_SESSION[${temp}] as $key => $val) //This works ok when the
> above stores 'g_kgkeys' properly.
>       {
>       $pkey[$key] = $val;
>       }
> --------------------------------------------------------------------
> In php.ini:
> register_globals = Off
> 
> Question: When including $_SESSION['g_kgkeys'] = $_POST['kgkeys'];
> within a block i.e. {}, should it function the same as outside the
block
> i.e. outside {}?
> 
> Your help would be appreciated.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to