嗨在我的应用程序中,我设计了一个带有HallTicketNo的表单如果我单击提交按钮它将根据hallticket转到结果页面我想要获取所有详细信息。我的问题是result.php它显示空白页面提取不是工作可以任何人帮助我
的index.php:
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/style_register.css" />
<link rel="stylesheet" type="text/css" media="all" href="css/responsive.css">
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/validation_script.js"></script>
</head>
<body>
<hr>
<img src="images/banner1.jpg" width="100%" />
<hr>
<section id="container">
<form id="result form" action="result.php" method="POST" enctype="multipart/form-data">
<div>
<label class="desc" id="title1" >Hall Ticket No.</label>
<div>
<input id="name" name="uname" type="text" class="field text fn" value="" size="8" tabindex="1">
<span class="val_name"></span>
</div>
</div>
<div>
<div>
<input type="submit" name="submit_registration" value="Submit" /><input type="reset" name="reset" value="Reset" />
</div>
</div>
</form>
</section>
</body>
</html>
result.php:
<?php
session_start();
if (isset($_SESSION['id'])) {
?>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" type="text/css" media="all" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/style_register.css" />
<link rel="stylesheet" type="text/css" media="all" href="css/responsive.css">
</head>
<body>
<img src="images/banner.jpg" width="100%" />
<section id="container">
<?php
include "../db.php";
$hallticket = $_REQUEST["uname"];
$query = mysql_query("SELECT * FROM results where Hall_Ticket_No='$hallticket'");
$row = mysql_fetch_array($query);
?>
<div id="title" align="center"><h3>Exam Results</h3></div>
<div id="tab">
<table align="center">
<tr><td><b>HallTicketNo</b></td><td> : <?php echo $row['HallTicketNo'];?></td></tr>
<tr><td><b>RNO</b></td><td> : <?php echo $row['RNO'];?></td></tr>
<tr><td><b>FirstName</b></td><td> : <?php echo $row['FirstName'];?></td></tr>
<tr><td><b>LastName</b></td><td> : <?php echo $row['LastName'];?></td></tr>
<tr><td><b>ClassID</b></td><td> : <?php echo $row['ClassID'];?></td></tr>
<tr><td><b>ClassName</b></td><td> : <?php echo $row['ClassName'];?>
<tr><td><b>ExamID</b></td><td> : <?php echo $row['ExamID'];?></td></tr>
<tr><td><b>ExamName</b></td><td> : <?php echo $row['ExamName'];?></td></tr>
<tr><td><b>ClassResult</b></td><td> : <?php echo $row['ClassResult'];?></td></tr>
<tr><td></td></tr>
</table>
<br>
<div id="sign" align="right"><img src="images/sign.png" height=100 width=80></div>
<br>
<center><a href="index.php"><input type="button" value="home" /></a></center>
</div>
</section>
</body>
</html>
<?php
}
?>
比你
答案 0 :(得分:1)
在index.php中,您没有启动会话而没有注册会话ID。这就是你的result.php的if条件没有执行的原因。 在index.php中添加此行。
<?php
session_start();
$_SESSION['id']= "1213"; //your id here
?>