I know this is an old post, but I got the same problem:
error:
arning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /mnt/w0207/d23/s08/b02d7009/www/designisbs.ca/johnbursic/edit_profile_verification.php:21) in /mnt/w0207/d23/s08/b02d7009/www/designisbs.ca/johnbursic/edit_profile_verification.php on line 25
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mnt/w0207/d23/s08/b02d7009/www/designisbs.ca/johnbursic/edit_profile_verification.php:21) in /mnt/w0207/d23/s08/b02d7009/www/designisbs.ca/johnbursic/edit_profile_verification.php on line 25
Code:
<?php
$form_username = $_POST['username'];
session_start();
if(!empty($_POST['surname'])){
foreach($_POST as $key => $value) {
$_SESSION['profile'][$key] = mysql_real_escape_string($value);
}
$fields = array("surname", "givenName", "homeSuite", "mailSuite", "homeAddy", "mailAddy", "homeCity", "mailCity", "homeProv", "mailProv", "homeCount", "homePost", "mailPost", "busPhone", "celPhone", "homPhone", "fax", "busEmail", "perEmail");
$sql .= "UPDATE users SET ";
$length = count($fields);
$n = 1;
foreach($fields as $field) {
if($n < $length) {
$sql .= "{$field}='{$_SESSION['profile'][$field]}',";
} else {
$sql .= "{$field}='{$_SESSION['profile'][$field]}'";
}
$n++;
}
$sql .= " WHERE username = '{$username}'";
if(mysql_query($sql, $link)){
// Successfull - Clear the Session
$_SESSION['profile'] = NULL;
echo("<p>{$form_username}'s Details have been saved.</p>\n");
}else{
$error = mysql_error();
echo("<p>There was an Error saving {$form_username}'s Details.</p>\n<p>{$error}</p>\n");
}
}else{
echo("<p>Please make sure all Required fields are Vaild</p>\n");
}
?>
Any ideas?