Warning: session_start() [function.session-start]:

I bet this is a really dumb question.
I am trying to convert Witango applications to PHP. So anything that I do in Witango, I am trying to replicate in PHP. It is coming along, but I have questions. So I was told to join this forum. I hope it helps.

I downloaded a normal Login page. With it came a page that is called check_login.php. This queries mySQL and if it finds a match, Registers a session, initialized two session variables and then branches to another page. This 3rd page is called, login_success.php. It is on this page that I am testing out different methods of working with PHP and mySQL.

When this page loads, I get the following error message:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Library/WebServer/Documents/php/login_success.php:2) in /Library/WebServer/Documents/php/login_success.php on line 3

Then it loads the rest of the page just fine.

Is there something in php.ini that I need to change to stop this from happening.

Here is the simple code for the login_success.php page.

<?php session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } //make popups MYSQL_CONNECT("127.0.0.1","username","password") OR DIE("Unable to connect to database"); //Customer List mysql_select_db("mydatabase") or die( "Unable to select database"); $query=("select * from customerinfo"); $result=mysql_query($query) or die ("Unable to Make the Query:" . mysql_error() ); //Class List $ccquery=("select distinct notesclassname from ccnotes order by notesclassname asc"); $ccresult=mysql_query($ccquery) or die ("Unable to Make the Query:" . mysql_error() ); //end make popups ?> <?php
Now Check This Out <?php

while($row=mysql_fetch_array($result)){

echo “”.$row[‘customerfirstname’]."";
}

?>

next popup <?php

while($row=mysql_fetch_array($ccresult)){

echo “”.$row[‘notesclassname’]."";
}

?>

What else would someone need to see in order to help me understand what this error is all about?

Thanks

Mark Weiss

[email protected]

HI

session_is_registered(myusername)

What is “myusername” ? a constant ? a string ?

Davy.

Sponsor our Newsletter | Privacy Policy | Terms of Service