Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2003, 12:28 AM
Authorized User
 
Join Date: Sep 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to major dynamic123
Default

Hi. Thanks for your reply. I have extracted a portion of the php.ini file on the session variable. I do not know what to change on the "session.save_path = /tmp"
variable. I need some help here.

...
; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
; As of PHP 4.0.1, you can define the path as:
; session.save_path = "N;/path"
; where N is an integer. Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories. This is useful if you
; or your OS have problems with lots of files in one directory, and is
; a more efficient layout for servers that handle lots of sessions.
; NOTE 1: PHP will not create this directory structure automatically.
; You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
; use subdirectories for session storage
session.save_path = /tmp

; Whether to use cookies.
session.use_cookies = 1
...

 
Old November 13th, 2003, 10:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, do you have a windows machine, or a unix/linux machine? If windows, then you'll use a windows path (e.g. c:\temp). If linux, you'll use a unix-style path (e.g. /tmp).

This directory is where PHP will store all the active session data, so you need to make sure the directory you specify exists and that PHP has access to read and write files in that directory.


Take care,

Nik
http://www.bigaction.org/
 
Old November 14th, 2003, 09:35 PM
Authorized User
 
Join Date: Sep 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to major dynamic123
Default

Hi, Nikolai. Thanks for your help. I've got the PHP script running. By the way, I have some questions about the code you've published here.

 $_SESSION['basket'][] = array('id' => $id,
                                  'price' => $price,
                                  'name' => $name);

What does the "=>" symbol mean?

Regards,
Major

 
Old November 14th, 2003, 09:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

=> is an operator that establishes the association between an array key (a.k.a. index) and a value.

For more info:
  http://www.php.net/types.array
  http://www.php.net/function.array


You also see this operator in the foreach() construct:

foreach ($my_array as $key => $value)
{
   ...
}


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
sessions p2ptolu Classic ASP Components 3 March 17th, 2005 06:31 AM
Sessions 2540EA BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 20th, 2005 05:42 AM
Mixing classic ASP sessions with ASP.NET sessions scorpion_king General .NET 2 August 4th, 2004 08:20 AM
Sessions aeejai Beginning PHP 3 April 22nd, 2004 01:51 PM
Help sessions ittorget Pro VB 6 2 April 20th, 2004 02:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.