Thanks again but here's what happens when I run that.
The form box appears.
I select an option.
I hit submit.
The page that loads says:
Warning: Invalid argument supplied for foreach() in
c:\apache\htdocs\session_yyy.php on line 13
I then hit the link:
Back to content page.
The form box
Anthony Ritter wrote:
Thanks again but here's what happens when I run that.
The form box appears.
I select an option.
I hit submit.
The page that loads says:
Warning: Invalid argument supplied for foreach() in
c:\apache\htdocs\session_yyy.php on line 13
I then hit the link:
Back to content page.
Sure.
Here it is.
There are three scripts.
session_1.php: the original form script.
session_1a.php: a revised script with a conditional else.
session_2.php: the receiving script for the session array variable.
Running script 1a and 2 works fine.
However the original script 1 and 2 gives me a
Additinally, upon looking at the session files in:
C:/apache/tmp:
I get from session file from script session_1a.php:
products|s:23:a:1:{i:0;s:6:Tardis;};
...
However, looking at session file from script session_1.php:
I get:
products|s:2:N;;
--
Anthony Ritter [EMAIL
Try changing references to $_SESSION[products] to $_SESSION['products']
-Original Message-
From: Anthony Ritter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 10:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] =sessions / J. Meloni Textbook=
Using mysql, apache and win98
The
Anthony Ritter wrote:
Using mysql, apache and win98
The following code is from PHP, mySQL and Apache (SAMS) by Julie Meloni.
Page 338-339 (hour 16).
After choosing my selections in the form box and hitting submit I get:
...
Warning: Invalid argument supplied for foreach() in
Anthony Ritter wrote:
The following code is from PHP, mySQL and Apache (SAMS) by Julie Meloni.
[snip]
if (isset($_POST[form_products])) {
if (!empty($_SESSION[products])) {
$products = array_unique(
array_merge(unserialize($_SESSION[products]),
$_POST[form_products]));
Thanks John and others.
I'm using the script and no values show up in the page:
session_bb.php
after I submit the values in the select form.
If somebody would like to test both scripts (session_aa.php and
session_bb.php) and get back to me I would be grateful.
As I said, these were from her
Anthony Ritter wrote:
I'm using the script and no values show up in the page:
session_bb.php
after I submit the values in the select form.
If somebody would like to test both scripts (session_aa.php and
session_bb.php) and get back to me I would be grateful.
I think you're using a crappy book...
9 matches
Mail list logo