X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 99BF214B281C for ; Thu, 12 Aug 2004 02:19:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64216-07 for ; Thu, 12 Aug 2004 05:19:12 +0000 (GMT) Received: from majolee.info (unknown [69.46.25.212]) by svr1.postgresql.org (Postfix) with ESMTP id 5BB1E14B2800 for ; Thu, 12 Aug 2004 02:19:10 -0300 (ADT) Received: from MAJOLEE1 [61.1.50.249] by majolee.info with ESMTP (SMTPD32-8.12) id AA341AB00FC; Thu, 12 Aug 2004 01:03:48 -0400 Message-ID: <006601c4802c$a07c3ef0$0c00a8c0@MAJOLEE1> From: "Majolee InfoTech" To: "Lynna Landstreet" Cc: References: Subject: Re: Strange session problem Date: Thu, 12 Aug 2004 10:54:08 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200408/20 X-Sequence-Number: 2908 Hello, The problem is you are not giving a name to that session. Use $_SESSION[image_ids] And it will be ok. =============== Mihir & Biren Partners Majolee InfoTech =============== ----- Original Message ----- From: "Lynna Landstreet" To: Cc: "Andres Ferrando" Sent: Thursday, August 12, 2004 2:07 AM Subject: Re: [PHP] Strange session problem > on 8/11/04 10:46 AM, Andres Ferrando at anferr@mecon.gov.ar wrote: > > > Some ideas: > > > > be sure that the index yo you use in $_SESSION (if any), is integer or > > string, and you aren't using array or similar as index. > > It just uses numeric keys - i.e. [0], [1], [2], etc. I assigned the image_id > array from the previous page to $_SESSION directly, as in $_SESSION = > $image_id. And then printed $_SESSION with print_r and everything seemed OK, > but when I go to the next page, $_SESSION is empty. > > > > how do you go to second page? if you use a header(rediret), you need to > > pass SID explicit. > > It goes to the second page by submitting a form. > > > > if nothing works, try posting code (important parts, as less) > > OK. Here it is. I've deleted irrelevant parts, like most of the HTML, and > just replaced them with notes in square brackets: > > ------------------------------------------------------------------------- > > > > [HTML header stuff] > > > > [That include file is just the database connection, which is called on every > page] > > [More HTML stuff - end of head section, beginning of body, navigation, etc.] > > > require_once("includes/login_check.inc.php"); // used on every page > > // some more HTML stuff here > > $image_id = $_POST['image_id']; // from form on previous page > > $image_query = "SELECT image_id, image_path, title > FROM images WHERE "; > > foreach ($image_id as $id) { > $image_query .= "image_id = " . $id . " OR "; > } > > $image_query = substr($image_query, 0, -4); // removes the final " or " > > $image_info = pg_fetch_all(pg_query($image_query)); > > // here it displays a table with all the images and their titles > > $_SESSION = $image_id; > > echo "
\n\nSession Contents:\n\n";
>
>     print_r ($_SESSION);
>
>     // that works, so as of this part, the correct data is in $_SESSION
>
>     echo "
"; > > ?> > > [a little more HTML] > >
> > > >
> > [yet more HTML, ending the page] > > ------------------------------------------------------------------------- > > Does that help? > > > Lynna > > -- > Resource Centre Database Coordinator > Gallery 44: www.gallery44.org > Database Project: www.gallery44db.org > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > >