I have a problem with sessions. Please, check what is wrong with my code
page1 is a form
page2
Code: Select all
session_start();
$_SESSION['ses_kod'] = $_POST['txtkod'];Then I have a page 3
Code: Select all
<?php session_start();
?>Thanks
Moderator: General Moderators
Code: Select all
session_start();
$_SESSION['ses_kod'] = $_POST['txtkod'];Code: Select all
<?php session_start();
?>Code: Select all
<?php session_start();
?>
<?php
require_once('../Connections/palso.php');
$colname_Recordset1 = "-1";
if (isset($_SESSION['ses_kod'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['ses_kod'] : addslashes($_SESSION['ses_kod']);
}
mysql_select_db($database_palso, $palso);
$query_Recordset1 = sprintf("SELECT * FROM `data` WHERE SchoolCode = '%s'", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $palso) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" />
<title>Ταξινόμηση υποψηφίων ανά επίπεδο</title>
<link href="styles.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
</head>
<body>
<div id="container">
<div id="list">
<h4>ΛΙΣΤΑ</h4>
<form id="form1" name="form1" method="get" action="tickets.php">
<input class="nav" type="submit" name="Submit" value="Εμφάνιση " />
<p></p>
<table width="600" border="1">
<tr>
<td width="20"> </td>
<td width="140" class="fields"><a href="list.php">LevelDescription</a></td>
<td width="140" class="fields"><a href="list_bin.php">BinSerialCode</a></td>
<td width="300" class="fields"><a href="list_sur.php">Surname</a></td>
</tr>
<?php do { ?>
<tr>
<td class="calign">
<input type="checkbox" name="checkbox[]" value="<?php echo $row_Recordset1['BinSerialCode']; ?>" /> </td>
<td class="calign"><?php echo $row_Recordset1['LevelDescription']; ?></td>
<td class="calign"><?php echo $row_Recordset1['BinSerialCode']; ?></td>
<td><?php echo $row_Recordset1['Surname']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</form>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>Code: Select all
session_start();
$_SESSION['ses_kod'] = $_POST['txtkod'];