Commit 53d12a1e authored by Srinivas's avatar Srinivas
Browse files

Update registrer3.php

parent 3f53de3d
<?php
session_start();
include('connection.php');
$connection = getdb();
?>
<!DOCTYPE html>
<html lang="en-ca">
......@@ -184,8 +187,6 @@ if($_SESSION['username4']){
<table>
<?php
$connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection,'test');
if(isset($_POST['search']))
{
......@@ -199,17 +200,16 @@ $password = $_POST['user_pass'];
$cpassword= $_POST['user_pass1'];
$HostelName = $_POST['HostelName'];
if ($cpassword==$password){
$conn = new mysqli('localhost','root','','test');
if($conn->connect_error){
die('Connection Failed : '.$conn->connect_error);
if($connection->connect_error){
die('Connection Failed : '.$connection->connect_error);
}
else{
$stmt = $conn->prepare("insert into user_login(username,Password,HostelName)
$stmt = $connection->prepare("insert into user_login(username,Password,HostelName)
values(?,?,?)");
$stmt->bind_param("sss",$username,$password,$HostelName);
$stmt->execute();
$stmt->close();
$conn->close();
$connection->close();
}echo "<script>location.href='success.php'</script>";
}
}
......@@ -223,4 +223,4 @@ echo "<script>location.href='3.php'</script>";
}
?>
</body>
</html>
\ No newline at end of file
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment