Commit c7c9e692 authored by stephanie.smith's avatar stephanie.smith

php

parent a0625225
<?php
$email = $_POST['emial'];
$password = $_POST['password'];
//connection
$con = new mysqli("localhost","root","","test");
if($con->connect_error){
die("failed to connect: ".$con->connect_error);
}else{
$stmt=$con->prepare("select * from registration where email = ?");
$stmt->bind_param("s",$email);
$stmt->execute();
$stmt_result=$stmt->get_result();
if ($stmt_result->num_rows>0){
if($data['password']=== $password)
echo "<h2>Login successful</h2>";
}else{
echo "<h2>Invalid email or password</h2>";
}
}
?>
\ No newline at end of file
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