Re: [PHP] a question, need an answer

2003-06-22 Thread Justin French
I think you mean:

$_SESSION['eventid'] = 'arma2';

vs

$eventid = 'arma2';
session_register('eventid');

I'd advise the first, unless you need to ensure backwards compatibility with
PHP < 4.1


Justin





on 22/06/03 4:41 PM, nabil ([EMAIL PROTECTED]) wrote:

> what is the diffirent between :
> //
> session_start ();
> $_SESSION['eventid'] = 'arma2';
> ///
> and
> /
> session_start ();
> session_register('arama2');
> ///
> 
> Regards
> Nabil
> 
> --
> ""open source world, open mind for all""
> 
> 


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



Re: [PHP] a question, need an answer

2003-06-22 Thread justin gruenberg

what is the diffirent between :
//
session_start ();
$_SESSION['eventid'] = 'arma2';
///
and
/
session_start ();
session_register('arama2');
///
Regards
Nabil
 

Both accomplish the same thing, except how you are using it might not be 
what you expect.

$_SESSION['eventid'] = 'arma2'; 
will assign the string "arma2" to $_SESSION['eventid'] (obviously).

session_register('arama2');
will make the variable $arma2 a session variable.  I believe you want 
session_register('eventid')
The session_register way of doing things makes it act a lot like register_globals is on.  It seems like we're trying to move away from this style of coding, so I'd suggest you use the first method with the $_SESSION variable.



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


RE: [PHP] a question, need an answer

2003-06-22 Thread PHP4 Emailer
PS, from the http://www.php.net/manual/en/function.session-register.php
page, you might want to read that because your second session call won't
work with register globals is disabled but $_SESSION array will.  :)

-Original Message-
From: PHP4 Emailer [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 22, 2003 3:46 AM
To: nabil; [EMAIL PROTECTED]
Subject: RE: [PHP] a question, need an answer


I could be wrong here, but from my experiences with sessions is that your
first session_start()
is assigning the value of 'arma2' to the $_SESSION['eventid'] variable,
whereas the second one you are making the 'arama2' variable a global session
variable, so as to whatever it's value is on the page can be called from
subsequent pages like post would do with a form script after a user hits
submit.

I'm still learning PHP, so I could be way off, but that's how it's been
working for me. *Shrugs*

Good Luck

-Original Message-
From: nabil [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 22, 2003 1:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] a question, need an answer


what is the diffirent between :
//
session_start ();
$_SESSION['eventid'] = 'arma2';
///
and
/
session_start ();
session_register('arama2');
///

Regards
Nabil

--
""open source world, open mind for all""



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



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



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



RE: [PHP] a question, need an answer

2003-06-22 Thread PHP4 Emailer
I could be wrong here, but from my experiences with sessions is that your
first session_start()
is assigning the value of 'arma2' to the $_SESSION['eventid'] variable,
whereas the second one you are making the 'arama2' variable a global session
variable, so as to whatever it's value is on the page can be called from
subsequent pages like post would do with a form script after a user hits
submit.

I'm still learning PHP, so I could be way off, but that's how it's been
working for me. *Shrugs*

Good Luck

-Original Message-
From: nabil [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 22, 2003 1:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] a question, need an answer


what is the diffirent between :
//
session_start ();
$_SESSION['eventid'] = 'arma2';
///
and
/
session_start ();
session_register('arama2');
///

Regards
Nabil

--
""open source world, open mind for all""



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



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