473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Receiving variable from session

After I register variable in session :

session_start();
session_register($var);

new page opens

include("register2.php");

At the page I fill some forms and send variables from forms to another
page - with GET method.

And now at the 3rd page I need to receive a variable from the session
but it's empty. Interesing is that on the second page receiving $var
from session works without any complications just by using:

session_start();
print ($var);

I have no idea what I did wrong and I would be grateful for advices,
maybe there is some other method of posting variables from "1st page
to 3rd". Thanks
Jul 17 '05 #1
3 1704
Do you have session_start(); in your third document?

Konrad wrote:
After I register variable in session :

session_start();
session_register($var);

new page opens

include("register2.php");

At the page I fill some forms and send variables from forms to another
page - with GET method.

And now at the 3rd page I need to receive a variable from the session
but it's empty. Interesing is that on the second page receiving $var
from session works without any complications just by using:

session_start();
print ($var);

I have no idea what I did wrong and I would be grateful for advices,
maybe there is some other method of posting variables from "1st page
to 3rd". Thanks

Jul 17 '05 #2
If your environment has register_globals turned off then you should not be
using session_register(). After performing session_start() in a script you
can put entries into and read entries out of the $_SESSION array.

To use session variables you MUST have performed session_start() earlier in
the script. It is this function which populates the $_SESSION array.

--
Tony Marston

http://www.tonymarston.net
"Konrad" <ko***@eranet.pl> wrote in message
news:51**************************@posting.google.c om...
After I register variable in session :

session_start();
session_register($var);

new page opens

include("register2.php");

At the page I fill some forms and send variables from forms to another
page - with GET method.

And now at the 3rd page I need to receive a variable from the session
but it's empty. Interesing is that on the second page receiving $var
from session works without any complications just by using:

session_start();
print ($var);

I have no idea what I did wrong and I would be grateful for advices,
maybe there is some other method of posting variables from "1st page
to 3rd". Thanks

Jul 17 '05 #3
I do have a session_start(). Actually I realized that problem concerns
PHPTriad configuration. After registering variable to session, the
session file includes only a variable name - without it's value. Maybe
you could advice me how to configure PHP Triad ;). Thanks for any
requests.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option...
2
by: Eric | last post by:
Hi, I've a problem with trying to retrieve a session variable in an include file. Basically, the main asp creates a session variable: <% Session("var1") = "Hello" %> And then when I click...
0
by: André Betz | last post by:
Hi, I've established a TCP-Socket Connection and now I want to receive datas. So I called BeginReceive where I set the receiving buffer and length. Now in the asynchronous CallBack-Function I...
4
by: John Kraft | last post by:
Hi all, My question is more of a phylisophical one here, but I am wondering what the difference is (effectively and performance wise) between using a shared variable/static variable and using a...
3
by: Sean W. | last post by:
I keep getting this error. "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive" This occurs when I try to add a...
5
by: Christian Hvid | last post by:
What is the easiest way to get the "row object" or "item object" when a datagrid is clicked? I have web form with a datagrid. And I have an array of something called BlogEntry that I bind to the...
1
by: Vidyadhar Joshi | last post by:
I have the following scenario in a true load balanced environment (without sticky sessions): There are 2 ASPX pages. I want to pass an object from the first page to the second page. On the...
4
by: Don Miller | last post by:
I am using a Session variable to hold a class object between ASP.NET pages (in VB). In my constructor I check to see if the Session variable exists, and if it doesn't, I create one and populate it...
17
by: Control Freq | last post by:
Hi, Not sure if this is the right NG for this, but, is there a convention for the variable names of a Session variable? I am using .NET 2.0 in C#. I am new to all this .NET stuff, So, any...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.