Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 25th, 2005, 05:27 PM
Authorized User
 
Join Date: Apr 2005
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing through sessions not working

Hi,

I am working on the Beginning php,mysql and apache book, chapter 2. I am having problems passing a value through a session.
I have typed the code exactly as it say in the book and I keep getting this error:

Warning: Cannot send session cookie - headers already sent by (output started at c:\phpdev\www\phppractise\music review site\movie1.php:2) in c:\phpdev\www\phppractise\music review site\movie1.php on line 3

Warning: Cannot send session cache limiter - headers already sent (output started at c:\phpdev\www\phppractise\music review site\movie1.php:2) in c:\phpdev\www\phppractise\music review site\movie1.php on line 3
Click here to see information about my favorite movie!

I am not sure what is happening here. Can anyone help?

I have checked the php.ini file for the correct session_save_path which seems to be pointing to the right file.

Any ideas whats wrong?

David


Reply With Quote
  #2 (permalink)  
Old April 26th, 2005, 05:27 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

U should use session_start() before u send anything ( html o/p) to browser; as PHP warns headers already sent
Simple logic is, if u've already started o/p, why r u re-modifying information ( session information ), sent to browser.

U may create buffer ( 4 PHP script ) by using ob_start()/ob_start()
( not recommended )

Reply With Quote
  #3 (permalink)  
Old April 26th, 2005, 08:21 AM
Authorized User
 
Join Date: Apr 2005
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I understand what you are saying, and thank you very much for getting back. I will try this out tonight. However, could you explain what o/p means? - silly question I know.

many thanks
David



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem passing through sessions dmlocke PHP Databases 4 June 26th, 2006 08:08 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 Variables through Sessions dmlocke Beginning PHP 2 April 27th, 2005 05:40 AM
Passing value without using sessions lic023 Classic ASP Basics 1 July 20th, 2004 09:58 AM
Help! My Sessions arent working Empier4552 PHP How-To 2 July 9th, 2003 03:24 PM



All times are GMT -4. The time now is 10:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.