session problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
elle_girl
Forum Newbie
Posts: 23
Joined: Sun Feb 20, 2005 10:02 am

session problem

Post 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]
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Did you search? I did and found 4 pages worth of answers on this forum :roll:
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

I'll even make it easier for you...

viewtopic.php?t=31555&highlight=
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Try moving some of the code around. Preferably to the front. :roll:
Post Reply