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

08-02-2009, 11:09 AM
I tried to make a profile update so members can update their information and I tried to embed a php code on my webpage and when I preview it, it says: sex == "male"){ $ckb="Male Female";} else {$ckb="Male Female";} // One form with a hidden field is prepared with default values taken from field. echo . And when I upload it it says: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/dejamad/public_html/signup/update-profile.php:7) in /home/dejamad/public_html/signup/include/session.php on line 2. Only this one does like that but the loin form and register works fine.
Here is the php code:

include "include/session.php";

include "include/z_db.php";

<!doctype html public "-//w3c//dtd html 3.2//en">


<title>(Type a title for your page here)</title>

<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">

<body >
// check the login details of the user and stop execution if not logged in
require "check.php";

// If member has logged in then below script will be execuated.
// let us collect all data of the member
$row=mysql_fetch_object(mysql_query("select * from plus_signup where userid='$_SESSION[userid]'"));

//Let us set the period button based on the data of the sex field
// You can see male button is checked if it is set to male
// else it is set to female
if($row->sex == "male"){
$ckb="<input type='radio' value=male checked name='sex' checked>Male
<input type='radio' value=female name='sex'>Female";}
else {$ckb="<input type='radio' value=male checked name='sex' >Male
<input type='radio' value=female name='sex' checked>Female";}

// One form with a hidden field is prepared with default values taken from field.
echo "<form action='update-profileck.php' method=post>
<input type=hidden name=todo value=update-profile>

<table border='0' cellspacing='0' cellpadding='0' align=center width='30%'>
<tr bgcolor='#ffffff' > <td colspan='2' align='center'>
<font face='verdana, arial, helvetica' size='2' align='center'>&nbsp;<b>Update Profile</b>
</font></td> </tr>

<tr bgcolor='#f1f1f1'><td ><font face='Verdana' size='2' >&nbsp;Email</td>
<td ><input type=text name=email value='$row->email'></td></tr>
<tr ><td >&nbsp;<font face='Verdana' size='2' >Name</td>
<td ><font face='Verdana' size='2'><input type=text name=name value='$row->name'></td></tr>

<tr bgcolor='#f1f1f1'><td >&nbsp;<font face='Verdana' size='2' >Sex</td>
<td ><font face='Verdana' size='2'> $ckb</td></tr>
<tr bgcolor='#ffffff'><td align=center colspan=2><input type=submit value=Update></td></tr></table>";
require "bottom.php";