Commit ff54775b authored by Srinivas's avatar Srinivas
Browse files

Update stureg.php

parent 0bd804bc
<?php
session_start();
include('connection.php');
$connection = getdb();
?>
<!DOCTYPE html>
<html lang="en-ca">
......@@ -174,8 +176,6 @@ if($_SESSION['username4']){
<table>
<?php
$connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection,'test');
if(isset($_POST['search']))
{
......@@ -189,17 +189,16 @@ $password = $_POST['user_pass'];
$cpassword= $_POST['user_pass1'];
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 student_login(username,Password)
$stmt = $connection->prepare("insert into student_login(username,Password)
values(?,?)");
$stmt->bind_param("ss",$username,$password);
$stmt->execute();
$stmt->close();
$conn->close();
$connection->close();
}
echo "<script>location.href='success.php'</script>";
}
......@@ -214,4 +213,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