473,383 Members | 1,870 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,383 software developers and data experts.

make $_SESSION[] global

Hi every one
I have project I need to make the value of $_SESSION[] available for
function in another php file
can any one help me to fix my problem
I will be thank full

Best
Salim
Feb 16 '08 #1
3 4344
..oO(sahm)
>I have project I need to make the value of $_SESSION[] available for
function in another php file
can any one help me to fix my problem
$_SESSION is a superglobal array, it's available from within any
function in any script. Just make sure that you call session_start() at
the very beginning of _every_ page to open the session. After that you
can simply access the data.

Micha
Feb 16 '08 #2
On Feb 16, 7:24 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(sahm)
I have project I need to make the value of $_SESSION[] available for
function in another php file
can any one help me to fix my problem

$_SESSION is a superglobal array, it's available from within any
function in any script. Just make sure that you call session_start() at
the very beginning of _every_ page to open the session. After that you
can simply access the data.

Micha
Dear Micha
Thank you for your help
Best Salim
Feb 16 '08 #3
..oO(sahm)
>Dear Micha
Thank you for your help
Best Salim
You're welcome.

Micha
Feb 16 '08 #4

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

Similar topics

0
by: Thomas Carcaud | last post by:
I read php manual many times but I can't figure out register_globals works. I m using Php 4.3.2 and register_globals on. It seems to have different effects on $_GET and $_SESSION. First with $_GET...
2
by: Håvard Olerud Eriksen | last post by:
I've been working on a webshop, and I've got most of the functionality up and running. One problem, however, that I don't seem to be able to solve is as follows. My shopping cart is stored in...
5
by: Rob Tweed | last post by:
Probably a simple question but I can't find the answer anyway. Specifically, is it possible to copy a multidimensional array into the $_SESSION array - ie a deep clone of all keys and data? I...
5
by: Ken | last post by:
What am I doing wrong? I set the variable co_name on the first page with an <input.... > and session_start() at the top of both pages. Clicking on a link that takes me to the second page: ...
2
by: Svend Andreas Horgen | last post by:
I used to believe I fully understood sessions... Apparently PHP does not handles numeric indexes in $_SESSION, as far as I can see. The same yields for both PHP 4 and 5. Suggestions or explanations...
0
by: Phil Powell | last post by:
What is the most standardized method of utilizing the CURL functions in PHP (version 4.3.2) to be able to retrieve the contents of a remote URL that happens to be dependent upon $_SESSION for its...
2
by: kimi | last post by:
Hi ppl, I am new to PHP. I would need some information on the following: 1. a) I wanted to know from where the data is extracted and stroed in the global assocoative arrays ( specifically...
0
by: sahm | last post by:
Hi every one I have project I need to make the value of $_SESSION available for function in another php file can any one help me to fix my problem I will be thank full Best Salim
4
by: Daz | last post by:
Hi everyone. I'm just wondering if it's considered bad practice to have a class read from and write to the $_SESSION super global. I was just learning a little about object serialization, and I've...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.