Connecting Tech Pros Worldwide Help | Site Map

Session varibles

  #1  
Old July 1st, 2008, 03:45 AM
www.phpbasic.com
Guest
 
Posts: n/a
I have a problem with session as:
if i write :
<?php
$_SESSION['id'] = 4;
$id = 7;
print $_SESSION['id']; // result: 4
?>
varible of $_SESSION['id'] is 4, but i write :
a.php
<?php
session_start();
$_SESSION['a'] = 4;
$a = 5;
echo '<a href="b.php">b.php</a>';
?>
b.php
<?php
session_start();
print $_SESSION['a']; // result: 5
?>
i use Apache 2.2.8, PHP 5.2.6 ( embed in AppServ 2.5.10)
help me!
  #2  
Old July 1st, 2008, 04:15 AM
Jerry Stuckle
Guest
 
Posts: n/a

re: Session varibles


www.phpbasic.com wrote:
Quote:
I have a problem with session as:
if i write :
<?php
$_SESSION['id'] = 4;
$id = 7;
print $_SESSION['id']; // result: 4
?>
varible of $_SESSION['id'] is 4, but i write :
a.php
<?php
session_start();
$_SESSION['a'] = 4;
$a = 5;
echo '<a href="b.php">b.php</a>';
?>
b.php
<?php
session_start();
print $_SESSION['a']; // result: 5
?>
i use Apache 2.2.8, PHP 5.2.6 ( embed in AppServ 2.5.10)
help me!
>
Check register_globals in your php.ini file. I suspect you will find it
is on. If so, turn it off - as it should be.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Variables ChrisN answers 1 November 19th, 2005 05:22 AM
Session varibles limit? Chris answers 2 November 19th, 2005 02:31 AM
Session varibles, loan balancing, and sticky sessions DeeAnn answers 4 November 17th, 2005 11:46 PM
Best way to get data into called page: session or new database call?? Perdit answers 6 July 19th, 2005 11:02 AM