Re: session_name("CCLTrolley")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php

session_name( 'CCLTrolley' );
session_start();

//
// Initialize the trolley.
//
if( !isset( $_SESSION['TrolleyContents'] ) )
{
   $_SESSION['TrolleyContents'] = '';
}

//
// Add new entry.
//
if( isset( $_POST['AddToTrolley'] ) )
{
   if( $_SESSION['TrolleyContents'] ) == '' )
   {
       $_SESSION['TrolleyContents'] = $_POST['AddToTrolley'];
   }
   else
   {
       $_SESSION['TrolleyContents'] .= ','.$_POST['AddToTrolley'];
   }
}

echo $_SESSION['TrolleyContents'];

phpinfo();

?>


Robert Cummings wrote:

John Taylor-Johnston wrote:
Robert Cummings wrote:

Why is it outdated semantics?


Might i refer you to:

http://ca.php.net/manual/en/language.variables.predefined.php
http://ca.php.net/manual/en/function.session-register.php

$HTTP_POST_VARS has been considered deprecated for some time now.
session_register() is considered clumsy and dangerous since it is only
works with register_globals enabled which is itself considered poor
coding style in this enlightened era of PHP.

Cheers,
Rob.
So use
$_POST["AddToTrolley"]
instead of
$HTTP_POST_VARS["AddToTrolley"]?

Thanks.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux