session_start() causing "Cannot send session cache limiter."
Posted: Tue Oct 14, 2008 4:49 pm
Hi
Can you help me on this problem?
I am doing two pages, when user click "account" button on display.php then go to edit.php with account details but when I try to add session_start() on top of edit, it bumps error message as title:
please give me a hand, thanks
Sorry I think a whole document will be better to read so I post it all.
display.php
edit.php
Can you help me on this problem?
I am doing two pages, when user click "account" button on display.php then go to edit.php with account details but when I try to add session_start() on top of edit, it bumps error message as title:
please give me a hand, thanks
Sorry I think a whole document will be better to read so I post it all.
display.php
Code: Select all
<?php
include 'conn.php';
include 'define.php';
session_start();
check_session_fail();
$sqlQuery1 = "select * from customer";
//?????
$selectR = mysql_db_query($dbname, $selectSQL, $connect);
if( !$selectR ){
echo " select fails !";
}
$add = "redirect('add.php')";
$edit = "redirect('edit.php?id=".$_SESSION['id']."')";
$logout = "redirect('login/logout.php')";
$clear = "redirect('clear.php')";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/global.css">
<script src="script.js"></script>
</head>
<body>
<center>
<table class="table1">
<tr>
<td align="center">
Display
</td>
</tr>
<tr>
<td align="center">
<img src="img/top.jpg">
</td>
</tr>
<!-- Greeting Message -->
<tr>
<td align="center">
Hello, <?php echo $_SESSION['myusername'];?> you are logged in.
</td>
</tr>
<tr>
<td>
<input type="button" value="Add" onclick=<?php echo $add;?>>
<input type="button" value="Account" onclick=<?php echo $edit;?>>
<input type="button" value="Search">
<input type="button" value="Clear" onclick=<?php echo $clear;?>>
<input type="button" value="Logout" onclick=<?php echo $logout;?>>
</td>
</tr>
<tr>
<td align="center">
<hr width="100%">
</td>
</tr>
<tr>
<td align="center">
Database
</td>
</tr>
<?php
while($row = mysql_fetch_array($selectR, MYSQL_ASSOC))
{
?>
<tr>
<td>
<hr>
</td>
</tr>
<tr>
<td align="center">
<table class="table2" width="220">
<tr>
<td width="120">
ID
</td>
<td>
<?php echo $row['id'];?>
</td>
</tr>
<tr>
<td>
Username
</td>
<td>
<?php echo $row['username'];?>
</td>
</tr>
<tr>
<td>
Address
</td>
<td>
<?php echo $row['address'];?>
</td>
</tr>
<tr>
<td>
Contact
</td>
<td>
<?php echo $row['contact'];?>
</td>
</tr>
<tr height="20">
<td>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="Input" type="button" value="Edit">
<input name="Input" type="button" value="Delete">
</td>
</tr>
</table>
</td>
</tr>
<?php
}
?>
<tr height="25">
<td><hr></td>
</tr>
</table>
</center>
</body>
</html>
Code: Select all
<?php
include 'conn.php';
include 'define.php';
session_start();
check_session_fail();
$id = $_REQUEST['id'];
$result = $_REQUEST['result'];
//echo "id=".$id;
$selectSQL = "select * from customer where id = ".$id;
$selectR = mysql_db_query($dbname, $selectSQL, $connect);
if( !$selectR ){
echo " select fails !";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Edit</title>
<link rel="stylesheet" type="text/css" href="style/global.css">
<script src="script.js"></script>
</head>
<body>
<center>
<form action="edit_proc.php">
<table class="table1">
<tr>
<td align="center">
Edit
</td>
</tr>
<tr>
<td align="center">
<img src="img/top.jpg">
</td>
</tr>
<tr>
<td align="center">
<hr width="100%">
</td>
</tr>
<?php
while($row = mysql_fetch_array($selectR, MYSQL_ASSOC))
{
?>
<tr>
<td align="center">
Details: <?php echo $row['username'];?>
</td>
</tr>
<tr>
<td align="center">
<hr width="100%">
</td>
</tr>
<tr>
<td>
<table>
<tr><td><input type="hidden" name="id" value=<?php echo $row['id'];?>></td></tr>
<tr>
<td width='10%'>Username</td>
<td width='20%'><input type="text" name="username" value=<?php echo $row['username'];?>></td>
</tr>
<!-- ?? -->
<!-- <tr>
<td width='10%'>Password</td>
<td width='20%'><input type="text" name="password"></td>
</tr> -->
<tr>
<td width='10%'>Address</td>
<td width='20%'><input type="text" name="address" value=<?php echo $row['address'];?>></td>
</tr>
<tr>
<td width='10%'>Contact</td>
<td width='20%'><input type="text" name="contact" value=<?php echo $row['contact'];?>></td>
</tr>
</table>
</td>
</tr>
<?php
}
?>
<tr>
<td align="center">
<hr width="100%">
</td>
</tr>
<tr>
<td align="center">
<input type="submit" value="Edit">
<input type="reset" value="Reset">
<input type="button" value="Back" onclick="redirect('display.php')">
<input type="button" value="Password" onclick="redirect('password.php')">
</td>
</tr>
<tr>
<td align="center">
<hr width="100%">
</td>
</tr>
<tr>
<td align="center">
<?php
if(!empty($result)){
if($result==1){
?>
The record has been successfully edited.
<?php
}
else{
?>
The record is incorrect!
<?php
}
}
?>
</td>
</tr>
</table>
</form>
</center>
</body>