Page 1 of 1

[function.session-start]

Posted: Sun Nov 20, 2011 5:13 am
by johnmergene

Code: Select all

<html>
<?
session_start();
$emailadd = $_SESSION['Emailadd'];
$con = mysql_connect("fdb3.leadhoster.com","xxxxxxxxxxxxxxx","xxxxxxx");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("xxxxxxxxxxxxxxxxxx", $con);

$result = mysql_query("SELECT * FROM Account WHERE Emailadd='$emailadd'");
while($row = mysql_fetch_array($result))
  {
          if($row['Md'] == 'None'){
          

	
	
	mysql_query("UPDATE Account SET DJ = '$_POST[DJ]'
	WHERE Emailadd=$emailadd");
	
          }
          else if($row['DJ'] == 'None'){
         
	
	
	
	mysql_query("UPDATE Account SET Md= '$_POST[Md]'
	WHERE Emailadd=$emailadd");
	}
  }

mysql_close($con);
?>
</html>




what is wrong with this code?
this is the error..
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /srv/disk4/xxxxxx0/www/xxxxxxxxxxxx.com/edit.php:2) in /srv/disk4/xxxxxxxx0/www/xxxxxxxxx.xxxxxxxxxxxxxx.com/edit.php on line 3

Re: [function.session-start]

Posted: Sun Nov 20, 2011 5:39 am
by twinedev
You must not output anything before you start the session, not even spacing/blank lines.

Re: [function.session-start]

Posted: Sun Nov 20, 2011 6:02 am
by johnmergene
i place a simple code for riderecting.. but. the values still the same. not updated

Re: [function.session-start]

Posted: Sun Nov 20, 2011 6:19 am
by twinedev
johnmergene wrote:i place a simple code for riderecting..
Have no idea what that means...

Re: [function.session-start]

Posted: Sun Nov 20, 2011 6:22 am
by johnmergene
is my code is correct? the codes after the session?

Re: [function.session-start]

Posted: Sun Nov 20, 2011 11:15 pm
by twinedev
The original code you posted, no it is not correct. You are outputting "<html>" and a newline character before starting the session