Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/projectaug2017/laptop/
Upload File :
Current File : /var/www/html/venkat/projectaug2017/laptop/submit.php

<?php
include("session.php");
include("db1.php");
$a = 0;
$stmt = $conn->prepare("INSERT INTO laptop (email, name, model, other, dept) VALUES (:email, :name, :model, :other, :dept)");
$stmt->bindParam(':email', $id);
$stmt->bindParam(':name', $name);
$stmt->bindParam(':model', addslashes($_POST['model']));
$stmt->bindParam(':other', addslashes($_POST['other']));
$stmt->bindParam(':dept', $dept);
if($stmt->execute()) {
	echo "<b> <center> <font color = 'blue'> Sucessfully Submitted </font>  </center> </b> <br> <br>";
}

$sql = $conn->prepare("SELECT name,model,other,dept FROM laptop where email = :rollno");
$sql->bindValue(':rollno',$id);
$sql->execute();
$row = $sql->rowCount();
if($row > 0) {
	while ($row = $sql->fetch()) {
		$name = $row['name'];
		$model = $row['model'];
		$other = $row['other'];
		$dept = $row['dept'];
	}
?>
<div align = "center">
	 <table> 
		<tr  colspan = "3"> <td> <b> Your preference </b>  </td> </tr>
	 	<tr> <td> <br> Your Name </td> <td>   <br> : </td>  <td> <br>  <?php echo $name ?> </td>  </tr>
	 	<tr> <td> <br> Your Final Model </td> <td>   <br> : </td>  <td> <br>  <?php echo $model ?> </td> </tr>  
	 	<tr> <td> <br> Other Model (if any) </td> <td>   <br> : </td>  <td> <br>  <?php echo $other ?> </td>  </tr>
	 	<tr> <td> <br> Department </td> <td>   <br> : </td>  <td> <br>  <?php echo $dept ?> </td>  </tr>
	</table>
 	 
</div>
<?php
}
?>