Page 1 of 1

passing variables between pages without using sessions

Posted: Sun Mar 06, 2005 8:34 am
by ananth_ak
how do i pass a variable $m from one page to any other without using session().

Posted: Sun Mar 06, 2005 8:36 am
by feyd
via url or posting (forms), cookies are also possible. Why avoid sessions?

Posted: Sun Mar 06, 2005 8:36 am
by patrikG
PHP Manual FAQ example 3

Posted: Sun Mar 06, 2005 8:40 am
by ananth_ak
the value i want to pass is from a form - using php_self i can pass the value within the page, but when i try to create a session for that posted value, its not allowing it.

Posted: Sun Mar 06, 2005 8:42 am
by ananth_ak
this is the error i get

Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0

Posted: Sun Mar 06, 2005 8:43 am
by feyd
it's not allowed because it says something like "headers already sent" :?:

If so, read our header already sent tutorial :) viewtopic.php?t=1157


edit: that looks like a problem with your coding..