Solved: PHP Sessions

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

lumentec

Thread Starter
Joined
Mar 23, 2008
Messages
103
I have a session that I start on a login.php page that stores a value called "items" taken from a MySQL Database to $_SESSION['items']. I set the value of the array on a page and it displays fine... but when I do this, it doesn't display.

Code:
<p id="items">
<?php 
echo $_SESSION['items'];
?>
</p>

Does the PHP not work inside the HTML? If so, how can I fix it?

Does the session expire for some reason? How can I fix that?
 
Joined
Sep 10, 2006
Messages
207
That seems fine,

On the page that you are requesting that session information, do you have session_start(); on that php file at all, or included from another PHP file

All pages which use the session information must include session_start();

Thanks James.
 

lumentec

Thread Starter
Joined
Mar 23, 2008
Messages
103
But now... I'm getting a PHP error...
"
Cannot send session cache limiter - headers already sent
"

I have no other PHP on the page... what's wrong?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top