Page 1 of 1

session problem

Posted: Tue Mar 15, 2005 9:35 am
by elle_girl

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
session_start();
session_register('token_id');
$refID = $_SESSION['token_id'];
$connection = mysql_connect('localhost','root', "") or die("Connection error!");
mysql_select_db("digitalcash",$connection);
$sql = "SELECT * FROM customer_bank,view WHERE token_id = '$refID'";
$result = mysql_query($sql) or die;

	$num_result = mysql_num_rows ($result);
	
	if($num_result == 0)
	{
		for ($i = 0; $i < $num_result; $i++)
			{
				$refID = mysql_result($result,$i, "token_id");
				$AccountNo = mysql_result($result,$i, "account_no");
				$Balance = mysql_result($result,$i, "balance");
				$price = mysql_result($result,$i, "price");
				
				$totalbalance = $balance - $price;
				
?>
<form name="" method="" action="">
	<p align="justify"><strong>BANK</strong></p>
	<div align="justify">
		<p><strong>Customer Information</strong></p>
		<p><strong>Reference ID :<input name="textfield3" type="text" value="<? echo $refID; ?>">
			</strong></p>
		</div>
		<p align="left"><strong>Account No :<input name="textfield" type="text" value="<? echo $AccountNo; ?>">
		</strong></p
		><p align="justify"><strong>Total Balance :<input name="textfield2" type="text" value="<? echo $totalbalance; ?>"></strong></p>
			<p align="justify">&nbsp;</p>
			</form>
			<?php
					}
			}
		?>
		</body>
	</html>
It appear this error

Code: Select all

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Apache Group\Apache2\htdocs\view_activity.php:10) in C:\Program Files\Apache Group\Apache2\htdocs\view_activity.php on line 11
Can you please help me to solve this problem?


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Tue Mar 15, 2005 9:51 am
by JayBird
Did you search? I did and found 4 pages worth of answers on this forum :roll:

Posted: Tue Mar 15, 2005 10:06 am
by CoderGoblin
I'll even make it easier for you...

viewtopic.php?t=31555&highlight=

Posted: Tue Mar 15, 2005 2:34 pm
by Ambush Commander
Try moving some of the code around. Preferably to the front. :roll: