-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsupervisor.php
51 lines (47 loc) · 1.23 KB
/
supervisor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form method='post' action='adminindex.php'>
帳號:<input type='text' name="loginname"><br>
密碼:<input type='password' name='password1'>
<input type='submit' name='submit' value='送出'>
<input type='reset' name='clear' value='清除'>
</form>
</body>
</html>
<?php
session_start();
$link= @mysqli_connect(
'140.127.218.156',
'travel',
'tra1043342',
'travel');
mysqli_query($link,'SET NAMES utf8');
if(isset($_POST['loginname'])){
$loginname=$_POST["loginname"];
$password=$_POST["password1"];
$login0="select * from login where login_username='$loginname' ";
$login1=" and login_password='$password'";
$logincheck=$login0.$login1;
$sql=mysqli_query($link,$logincheck);
$rows=mysqli_num_rows($sql);
if($rows==""){
?>
<script language="JavaScript">
alert("沒有這個帳號,請重新輸入");
history.back();
</script>
<?php
}
else{
$list=mysqli_fetch_array($sql);
$_SESSION["login_username"]=$list['login_username'];
header("Location:./adminindex.php");
}
}
mysqli_close($link);
?>