passing variables between pages without using sessions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ananth_ak
Forum Newbie
Posts: 23
Joined: Wed Feb 09, 2005 12:42 pm
Location: uk, london
Contact:

passing variables between pages without using sessions

Post by ananth_ak »

how do i pass a variable $m from one page to any other without using session().
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

via url or posting (forms), cookies are also possible. Why avoid sessions?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

PHP Manual FAQ example 3
ananth_ak
Forum Newbie
Posts: 23
Joined: Wed Feb 09, 2005 12:42 pm
Location: uk, london
Contact:

Post 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.
ananth_ak
Forum Newbie
Posts: 23
Joined: Wed Feb 09, 2005 12:42 pm
Location: uk, london
Contact:

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
Post Reply