Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sessions problem

Status
Not open for further replies.

Elmserv

Programmer
Sep 25, 2004
72
GB
can anyone see what is wrong with this
Code:
<?php session_start(); 
 
  session_start();
  $_SESSION['hotel'][0] = 'B'; 
  Print $_SESSION['hotel'][0];
  
?>

calls this bit of code on another page
Code:
<?php
Print $_SESSION['hotel'][0];
?>

nothing appears when the second file is run
 
try changing the second code to
Code:
session_start();
print $_SESSION['hotel'][0];
 
so I have to start a session on each file
 
yes. read the faq on sessions posted by sleipnir214. it explains the anatomy of what a session is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top