Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning 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 April 26th, 2005, 05:04 PM
Authorized User
 
Join Date: Apr 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Variables through Sessions

Hi,

This is really pissing me off now!

I am working on chapter 2 of beginning php,mysql and apache - moviesite.php and movie1.php. I am now working on Passing variables through sessions. I have cut and past the code (which I downloaded from the wrox site) for both php files (therefore if the code is coming from the source, it surely must be ok).

Every time I click the hyperlink: "click here to see information...." on the movie1.php, it should return:

Welcome to our site Joe 12345
My favourite movie is Life of Brian
My movie rating for this movie is : 5

However (even when I use the code from the book) No session information is passed at all, and all I get is:


My favorite movie is Life of Brian
My movie rating for this movie is: 5

I have checked the registered globals are off (they are) and made sure the php.ini file "session_save_path" is pointing to the C:/temp (which it is).

Does anybody no whats wrong or what I am doing wrong? I basically can't progress through the book until I resolve the problem as the next section uses sessions and cookies, and It won't work if the sessions don't work.

Help!!!!!

Kind regards
David


 
Old April 26th, 2005, 06:36 PM
Registered User
 
Join Date: Apr 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Wade
Default

Well, lots of things could be happening.

Do you have session_start(); as the first output on the page.

Make sure that you are calling and setting the sessions with session capitalized like so.

$_SESSION['name'] = "Joe 12345";

echo ($_SESSION['name']);

Thats the only thing I can think of. I havn't read that book so I don't really know whats trying to be done. Hope this helps.
 
Old April 27th, 2005, 05:40 AM
Authorized User
 
Join Date: Apr 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much for your help. I'll give it a try.

David






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem passing through sessions dmlocke PHP Databases 4 June 26th, 2006 08:08 PM
Ch. 2 - Passing Variables with Sessions tks001 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 February 20th, 2006 07:26 PM
Passing through sessions dmlocke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 May 15th, 2005 11:35 AM
passing through sessions not working dmlocke PHP Databases 2 April 26th, 2005 08:21 AM
Passing value without using sessions lic023 Classic ASP Basics 1 July 20th, 2004 09:58 AM





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