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 May 8th, 2005, 05:34 PM
Authorized User
 
Join Date: May 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Probelem using sessionstart()

Hi,

i noticed another guy had a problem here using the SESSIONSTART() command, and i do too.. Here is my code:




  <?php

ob_start();
 session_start();




require_once('reg_form_functions.php');

//create our variable names
$email=$_POST['email'];
$username=$_POST['username'];
$password=$_POST['password'];
$password=$_POST['password2'];

 ?>

The above code generates the following errors:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /content/StartupHostPlus/j/s/www.jsten.co.uk/web/register_new.php:8) in /content/StartupHostPlus/j/s/www.jsten.co.uk/web/register_new.php on line 11

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /content/StartupHostPlus/j/s/www.jsten.co.uk/web/register_new.php:8) in /content/StartupHostPlus/j/s/www.jsten.co.uk/web/register_new.php on line 11
hello

Why would this be so.. I notice that the solution apparantly is to include the sessionstart() first, but i am here and i am still getting this error.

Thanks

Steve


 
Old May 9th, 2005, 09:56 AM
Authorized User
 
Join Date: Jan 2005
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do
<?php
session_start();
ob_start();

...

?>

----------------
Never bother to learn something not knowing which does not do you any harm, and never neglect to learn something whose negligence will increase your ignorance - Imam Jafar Sadeq
 
Old May 11th, 2005, 03:21 PM
Authorized User
 
Join Date: May 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thankyou for the reply.. i now haveit working...

Cheers
Steve










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