Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2005, 04:09 AM
Authorized User
 
Join Date: Jul 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to vinodkalpaka Send a message via Yahoo to vinodkalpaka
Default session problem

i have used the $_SESSION[] array to set a variable, but i cannot get that in a page when i visit the page for the first time.when i visit it second time i get the values.Please help me to sort out the issue.

 
Old March 2nd, 2005, 02:07 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perhaps you could place a bit of your code down?
if you put:
<?php
session_start();
print $_SESSION['animal'];
$_SESSION['animal']="Zebra";
?>
then officialy you're not going to see it before you refresh the form .. ??!
 
Old March 27th, 2005, 01:18 PM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have had same problem. There was two PHP seperate sites I was using session in. However one of them was working; other was always not. Actually it even was not giving errors or warnings. In fact, I had to unuse sessions. I looked at bugs list. There was something related to this. I think it was because, I called "session_start()" from an include file.

I could not solved problem yet. If anyone who knows sth. about this problem, could help?
 
Old March 28th, 2005, 01:45 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

This problem may be easily solved:
In php.ini, session.use_trans_sid is usually disabled; hence u've2pass SID in url to other Web pages, session_start() should be called at the top of Web page code, and session variables should be declared, befrore u echo/c them.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Out Problem kasipandian J2EE 3 March 21st, 2008 03:35 PM
session problem MunishBhatia ASP.NET 2.0 Professional 9 October 6th, 2007 04:06 AM
Session problem abdulweb General .NET 3 August 27th, 2007 08:01 PM
session and cookie problem (empty session file) msincan BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 27th, 2005 05:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.