check.php
<?php
session_start();
include 'connect.php';
$sql = "SELECT * FROM herb where admin_username =
'".mysqli_real_escape_string($link,$_POST['username'])."'
and admin_password = '".mysqli_real_escape_string($link,$_POST['password'])."'";
$query = mysqli_query($link,$sql);
while ($result = mysqli_fetch_array($query,MYSQLI_ACCOS)){};
if (!$result) {
echo "Username and Password Incorrect !";
}else {
session_write_close();
header("location:indexAdmin.php");
}
mysqli_close($link);
?>
Warning: Use of undefined constant MYSQLI_ACCOS - assumed 'MYSQLI_ACCOS' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\DatabaseHerb\check.php on line 8
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\DatabaseHerb\check.php on line 8
Username and Password Incorrect !
อะ ครับ
Tag : PHP, MySQL
Date :
2018-08-13 00:31:39
By :
1952256734819349
View :
1233
Reply :
4
No. 1
Guest
Code (PHP)
<?php
session_start();
include 'connect.php';
$sql = "SELECT * FROM herb where admin_username =
'".mysqli_real_escape_string($link,$_POST['username'])."'
and admin_password = '".mysqli_real_escape_string($link,$_POST['password'])."'";
$query = mysqli_query($link,$sql);
while ($result = mysqli_fetch_array($query,MYSQLI_ACCOS)){};
if (!$result) {
echo "Username and Password Incorrect !";
}else {
session_write_close();
header("location:indexAdmin.php");
}
mysqli_close($link);
?>